pax_global_header00006660000000000000000000000064151476537460014534gustar00rootroot0000000000000052 comment=2d52b47cfd88b703d3247f77bb7c3ad7372bc9cb CastXML-CastXML-892090e/000077500000000000000000000000001514765374600145425ustar00rootroot00000000000000CastXML-CastXML-892090e/.clang-format000066400000000000000000000011001514765374600171050ustar00rootroot00000000000000--- # This configuration requires clang-format version 18 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 QualifierAlignment: Right SortUsingDeclarations: false SpaceAfterTemplateKeyword: true ... CastXML-CastXML-892090e/CMakeLists.txt000066400000000000000000000146121514765374600173060ustar00rootroot00000000000000#============================================================================= # 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 # # https://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 3.10) 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() 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() # If several LLVM versions provide CMake packages, try to use the latest one. set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL) set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC) # 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() 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() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") string(APPEND CMAKE_CXX_FLAGS " -Zc:preprocessor") endif() if(CYGWIN OR MINGW) # Use GNU extensions on Windows as LLVM upstream does. set(CMAKE_CXX_EXTENSIONS ON) else() set(CMAKE_CXX_EXTENSIONS OFF) endif() if(LLVM_VERSION_MAJOR GREATER 15) set(CMAKE_CXX_STANDARD 17) elseif(LLVM_VERSION_MAJOR GREATER 9) set(CMAKE_CXX_STANDARD 14) else() set(CMAKE_CXX_STANDARD 11) endif() # Reserve ~10MB stack size on Windows, as LLVM upstream does. if(MSVC) string(APPEND CMAKE_EXE_LINKER_FLAGS " -STACK:10000000") 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() elseif(IS_DIRECTORY "${d}/clang/${LLVM_VERSION_MAJOR}/include") set(CLANG_RESOURCE_DIR ${d}/clang/${LLVM_VERSION_MAJOR}) 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-CastXML-892090e/LICENSE000066400000000000000000000261361514765374600155570ustar00rootroot00000000000000 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-CastXML-892090e/NOTICE000066400000000000000000000002011514765374600154370ustar00rootroot00000000000000CastXML Copyright 2013-2022 Kitware, Inc. This product includes software developed at Kitware, Inc. (https://www.kitware.com/). CastXML-CastXML-892090e/README.rst000066400000000000000000000053201514765374600162310ustar00rootroot00000000000000CastXML ******* 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`: https://www.kitware.com/ .. _`ITK`: https://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`: https://www.apache.org/licenses/LICENSE-2.0 Superbuild ========== If you are looking for pre-built binaries, or a compact way to build this project, please see `CastXMLSuperbuild`_. .. _`CastXMLSuperbuild`: https://github.com/CastXML/CastXMLSuperbuild 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 - Git ``master`` as of 2026-02-10 (``22c6b7047b``) - Release ``22.1`` - Release ``21.1`` - Release ``20.1`` - Release ``19.1`` - Release ``18.1`` - Release ``17.0`` - Release ``16.0`` - Release ``15.0`` - Release ``14.0`` - Release ``13.0`` - Release ``12.0`` - Release ``11.0`` - Release ``10.0`` - Release ``9.0`` - 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`: https://cmake.org/ .. _`LLVM/Clang`: https://clang.llvm.org/ .. _`Sphinx`: https://www.sphinx-doc.org/ CastXML-CastXML-892090e/doc/000077500000000000000000000000001514765374600153075ustar00rootroot00000000000000CastXML-CastXML-892090e/doc/CMakeLists.txt000066400000000000000000000064111514765374600200510ustar00rootroot00000000000000#============================================================================= # 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 # # https://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-CastXML-892090e/doc/conf.py.in000066400000000000000000000052221514765374600172140ustar00rootroot00000000000000#============================================================================= # 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 # # https://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(r'^\.\. 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-CastXML-892090e/doc/index.rst000066400000000000000000000003261514765374600171510ustar00rootroot00000000000000.. title:: CastXML Documentation Command-Line Tools ################## .. toctree:: :maxdepth: 1 /manual/castxml.1 .. only:: html Index and Search ################ * :ref:`genindex` * :ref:`search` CastXML-CastXML-892090e/doc/manual/000077500000000000000000000000001514765374600165645ustar00rootroot00000000000000CastXML-CastXML-892090e/doc/manual/castxml.1.rst000066400000000000000000000157751514765374600211470ustar00rootroot00000000000000.. 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`: https://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. Schema ====== XML Schema that describes both output formats is available: :download:`castxml.xsd`. 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. 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-CastXML-892090e/doc/manual/castxml.xsd000066400000000000000000000462351514765374600207710ustar00rootroot00000000000000 CastXML-CastXML-892090e/doc/templates/000077500000000000000000000000001514765374600173055ustar00rootroot00000000000000CastXML-CastXML-892090e/doc/templates/layout.html000066400000000000000000000004021514765374600215040ustar00rootroot00000000000000{% extends "!layout.html" %} {% block rootrellink %}
  • CastXML{{ reldelim1 }}
  • {{ shorttitle|e }}{{ reldelim1 }}
  • {% endblock %} CastXML-CastXML-892090e/share/000077500000000000000000000000001514765374600156445ustar00rootroot00000000000000CastXML-CastXML-892090e/share/castxml/000077500000000000000000000000001514765374600173175ustar00rootroot00000000000000CastXML-CastXML-892090e/share/castxml/detect_vs.c000066400000000000000000000101341514765374600214420ustar00rootroot00000000000000/* 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 https://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-CastXML-892090e/share/castxml/detect_vs.cpp000066400000000000000000000111031514765374600217770ustar00rootroot00000000000000/* 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 https://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-CastXML-892090e/share/castxml/empty.c000066400000000000000000000000001514765374600206070ustar00rootroot00000000000000CastXML-CastXML-892090e/share/castxml/empty.cpp000066400000000000000000000000001514765374600211470ustar00rootroot00000000000000CastXML-CastXML-892090e/src/000077500000000000000000000000001514765374600153315ustar00rootroot00000000000000CastXML-CastXML-892090e/src/CMakeLists.txt000066400000000000000000000047001514765374600200720ustar00rootroot00000000000000#============================================================================= # 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 # # https://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}) if(CLANG_LINK_CLANG_DYLIB) if(NOT TARGET clang-cpp) message(FATAL_ERROR "CLANG_LINK_CLANG_DYLIB requires a LLVM/Clang providing clang-cpp") endif() if(NOT LLVM_LINK_LLVM_DYLIB) message(FATAL_ERROR "CLANG_LINK_CLANG_DYLIB requires a LLVM/Clang built with LLVM_LINK_LLVM_DYLIB") endif() set(clang_libs clang-cpp) else() set(clang_libs clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangEdit clangAST clangLex clangBasic ) endif() 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}) if(LLVM_VERSION_MAJOR GREATER 5) set(maybe_PRIVATE "PRIVATE") else() set(maybe_PRIVATE "") endif() target_link_libraries(castxml ${maybe_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-CastXML-892090e/src/ClangResourceDir.txt.in000066400000000000000000000000251514765374600216670ustar00rootroot00000000000000@CLANG_RESOURCE_DIR@ CastXML-CastXML-892090e/src/Detect.cxx000066400000000000000000000212251514765374600172670ustar00rootroot00000000000000/* 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 https://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/Config/llvm-config.h" #if LLVM_VERSION_MAJOR >= 17 # include "llvm/TargetParser/Host.h" # include "llvm/TargetParser/Triple.h" #else # include "llvm/ADT/Triple.h" # include "llvm/Support/Host.h" #endif #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/FileSystem.h" #include #include #include #include static std::string getClangBuiltinIncludeDir() { return getClangResourceDir() + "/include"; } static bool failedCC(char const* 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(std::string& pd, std::string const& rm) { std::string::size_type beg = 0; while ((beg = pd.find(rm, 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 fixPredefines(Options& opts) { // Remove any detected conflicting definition of a Clang builtin macro. fixPredefines(opts.Predefines, "#define __bool "); fixPredefines(opts.Predefines, "#define __builtin_vsx_"); fixPredefines(opts.Predefines, "#define __has_"); fixPredefines(opts.Predefines, "#define __pixel "); fixPredefines(opts.Predefines, "#define __vector "); } 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"); } else if (pd.find("#define __aarch64__ 1") != pd.npos || pd.find("#define _M_ARM64 ") != pd.npos) { triple.setArchName("aarch64"); } else if (pd.find("#define __arm__ 1") != pd.npos || pd.find("#define _M_ARM ") != pd.npos) { triple.setArchName("arm"); } if (pd.find("#define _WIN32 1") != pd.npos) { triple.setVendorName("pc"); triple.setOSName("windows"); } if (pd.find("#define _MSC_VER ") != pd.npos) { triple.setEnvironmentName("msvc"); } if (pd.find("#define __MINGW32__ 1") != pd.npos) { triple.setEnvironmentName("gnu"); } opts.Triple = triple.getTriple(); } static bool isBuiltinIncludeDir(std::string const& inc) { // FIXME: Intrinsics headers are platform-specific. // Is there a better way to detect this directory? return (llvm::sys::fs::exists(inc + "/emmintrin.h") // x86_64 || llvm::sys::fs::exists(inc + "/altivec.h") // ppc64 || llvm::sys::fs::exists(inc + "/arm_neon.h") // aarch64 ); } static bool detectCC_GNU(char const* const* argBeg, char const* const* argEnd, Options& opts, char const* id, char const* 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; char const* start_line = "#include <...> search starts here:"; if (char const* c = strstr(err.c_str(), start_line)) { if ((c = strchr(c, '\n'), c++)) { while (*c++ == ' ') { if (char const* e = strchr(c, '\n')) { char const* 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 && isBuiltinIncludeDir(inc)) { 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(char const* const* argBeg, char const* const* argEnd, Options& opts, char const* id, char const* 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; // Create a temporary directory to hold some temporary files. llvm::SmallString<128> tmpDir; if (std::error_code e = llvm::sys::fs::createUniqueDirectory("castxml", tmpDir)) { msg = e.message(); return failedCC(id, cc_args, out, err, msg); } // Tell MSVC to put the object file in the temporary directory. // We previously used '-FoNUL' but this does not work on Windows 11. llvm::SmallString<128> tmpObj = tmpDir; tmpObj.append("/detect_vs.obj"); llvm::SmallString<128> argFo("-Fo"); argFo.append(tmpObj); // Extend the original command line with our source and object. cc_args.push_back("-c"); cc_args.push_back(detect_vs_cpp.c_str()); cc_args.push_back(argFo.c_str()); // Run the compiler. bool success = runCommand(int(cc_args.size()), &cc_args[0], ret, out, err, msg) && ret == 0; // Remove temporary object file and directory. llvm::sys::fs::remove(llvm::Twine(tmpObj)); llvm::sys::fs::remove(llvm::Twine(tmpDir)); // Check results. if (success) { if (char const* predefs = strstr(out.c_str(), "\n#define")) { opts.Predefines = predefs + 1; } if (char const* 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(char const* id, char const* const* argBeg, char const* 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-CastXML-892090e/src/Detect.h000066400000000000000000000015171514765374600167160ustar00rootroot00000000000000/* 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 https://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(char const* id, char const* const* argBeg, char const* const* argEnd, Options& opts); #endif // CASTXML_DETECT_H CastXML-CastXML-892090e/src/Options.h000066400000000000000000000025131514765374600171360ustar00rootroot00000000000000/* 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 https://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-CastXML-892090e/src/Output.cxx000066400000000000000000002607761514765374600173770ustar00rootroot00000000000000/* 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 https://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 "llvm/Config/llvm-config.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.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/NestedNameSpecifier.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/RecordLayout.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/Specifiers.h" #include "clang/Basic/TargetInfo.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Lex/Preprocessor.h" #include "llvm/Support/raw_ostream.h" #include #include #include #include #include #include #include #if LLVM_VERSION_MAJOR >= 21 # include "clang/AST/DeclOpenACC.h" #endif #if LLVM_VERSION_MAJOR >= 16 # include namespace cx { template using optional = std::optional; } #else # include namespace cx { template using optional = llvm::Optional; } #endif #if LLVM_VERSION_MAJOR >= 16 namespace cx { using FileEntryRef = clang::FileEntryRef; using OptionalFileEntryRef = clang::OptionalFileEntryRef; } #elif LLVM_VERSION_MAJOR >= 12 namespace cx { using FileEntryRef = clang::FileEntryRef; using OptionalFileEntryRef = llvm::Optional; } #else namespace cx { using FileEntryRef = clang::FileEntry const*; using OptionalFileEntryRef = clang::FileEntry const*; } #endif #if LLVM_VERSION_MAJOR >= 22 namespace cx { using NestedNameSpecifier = clang::NestedNameSpecifier; NestedNameSpecifier const& deref(NestedNameSpecifier const& nns) { return nns; } } #else namespace cx { using NestedNameSpecifier = clang::NestedNameSpecifier*; clang::NestedNameSpecifier const& deref(NestedNameSpecifier const& nns) { return *nns; } } #endif #if LLVM_VERSION_MAJOR >= 18 # define cx_ElaboratedTypeKeyword(x) clang::ElaboratedTypeKeyword::x # define cx_TagTypeKind(x) clang::TagTypeKind::x #else # define cx_ElaboratedTypeKeyword(x) clang::ETK_##x # define cx_TagTypeKind(x) clang::TTK_##x #endif #if LLVM_VERSION_MAJOR < 16 # define starts_with startswith #endif #if LLVM_VERSION_MAJOR < 18 # define isPureVirtual isPure #endif 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); \ } #if LLVM_VERSION_MAJOR >= 10 # include "clang/AST/TypeNodes.inc" #else # include "clang/AST/TypeNodes.def" #endif void OutputUnimplementedType(clang::Type const* t, DumpNode const* dn) { /* clang-format off */ this->OS << " Index << "\" type_class=\"" << encodeXML(t->getTypeClassName()) << "\"/>\n"; /* clang-format on */ } std::string getNameOfFileEntryRef(cx::FileEntryRef f) const { #if LLVM_VERSION_MAJOR >= 12 return std::string(f.getName()); #else return std::string(f->getName()); #endif } cx::OptionalFileEntryRef getFileEntryRefForID(clang::FileID id) const { #if LLVM_VERSION_MAJOR >= 12 return this->CI.getSourceManager().getFileEntryRefForID(id); #else return this->CI.getSourceManager().getFileEntryForID(id); #endif } }; 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; } }; struct CommentEntry { unsigned int Index; clang::RawComment const* Comment; DumpNode const* Attached; }; 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); #if LLVM_VERSION_MAJOR >= 22 /** Remove type info that we do not care about to avoid duplication. */ clang::QualType ConsolidateType(clang::QualType t); clang::Type const* ConsolidateTypeImpl(clang::Type const* t); #endif /** Allocate a dump node for a source file entry. */ unsigned int AddDumpFile(cx::FileEntryRef f); #if LLVM_VERSION_MAJOR < 12 unsigned int AddDumpFile(clang::FileEntry const& f) { return this->AddDumpFile(&f); } #endif /** 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 ProcessCommentQueue(); 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); void PrintNameAttribute(llvm::StringRef 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 init="..." attribute. */ void PrintInitAttribute(clang::Expr const* init); /** 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); /** Print a comment="..." attribute showing the declaration's comment. */ void PrintCommentAttribute(clang::Decl const* d, DumpNode const* dn); /** 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, char const* tag, unsigned int flags, cx::optional const& name = cx::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, char const* 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 PrintCastXMLTypedef(clang::TypedefDecl const* d, DumpNode const* dn); bool IsCastXMLTypedefType(clang::QualType t) const; bool IsCastXMLTypedefDecl(clang::TypedefDecl const* td) const; #if LLVM_VERSION_MAJOR >= 22 bool IsElaboratedType(clang::TagType const* t) const { return (t->getKeyword() != clang::ElaboratedTypeKeyword::None || t->getQualifier()); } bool IsElaboratedType(clang::TemplateSpecializationType const* t) const { return t->getKeyword() != clang::ElaboratedTypeKeyword::None; } bool IsElaboratedType(clang::TypedefType const* t) const { return static_cast(t->getQualifier()); } clang::QualType GetElaboratedTypeNamed(clang::TagType const* t) const { return t->getCanonicalTypeUnqualified(); } clang::QualType GetElaboratedTypeNamed( clang::TemplateSpecializationType const* t) const { return t->getCanonicalTypeUnqualified(); } clang::QualType GetElaboratedTypeNamed(clang::TypedefType const* t) const { return this->CTX.getTypedefType(t->getKeyword(), std::nullopt, t->getDecl(), t->desugar()); } clang::ElaboratedTypeKeyword GetElaboratedTypeKeyword( clang::TagType const* t) const { return t->getKeyword(); } clang::ElaboratedTypeKeyword GetElaboratedTypeKeyword( clang::TemplateSpecializationType const* t) const { return t->getKeyword(); } clang::ElaboratedTypeKeyword GetElaboratedTypeKeyword( clang::TypedefType const*) const { return clang::ElaboratedTypeKeyword::None; } cx::NestedNameSpecifier GetElaboratedTypeQualifier( clang::TagType const* t) const { return t->getQualifier(); } cx::NestedNameSpecifier GetElaboratedTypeQualifier( clang::TemplateSpecializationType const* t) const { return std::nullopt; } cx::NestedNameSpecifier GetElaboratedTypeQualifier( clang::TypedefType const* t) const { return t->getQualifier(); } #else bool IsElaboratedType(clang::TagType const*) const { return false; } bool IsElaboratedType(clang::TemplateSpecializationType const*) const { return false; } bool IsElaboratedType(clang::TypedefType const*) const { return false; } bool IsElaboratedType(clang::ElaboratedType const* t) const { return (t->getKeyword() != cx_ElaboratedTypeKeyword(None) || t->getQualifier()); } clang::QualType GetElaboratedTypeNamed(clang::ElaboratedType const* t) const { return t->getNamedType(); } clang::ElaboratedTypeKeyword GetElaboratedTypeKeyword( clang::ElaboratedType const* t) const { return t->getKeyword(); } cx::NestedNameSpecifier GetElaboratedTypeQualifier( clang::ElaboratedType const* t) const { return t->getQualifier(); } #endif // 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 OutputAtomicType(clang::AtomicType const* t, DumpNode const* dn); void OutputAutoType(clang::AutoType const* t, DumpNode const* dn); 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 OutputRValueReferenceType(clang::RValueReferenceType 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); #if LLVM_VERSION_MAJOR >= 22 void OutputEnumType(clang::EnumType const* t, DumpNode const* dn) { this->OutputElaboratedTypeImpl(t, dn); } void OutputRecordType(clang::RecordType const* t, DumpNode const* dn) { this->OutputElaboratedTypeImpl(t, dn); } void OutputTypedefType(clang::TypedefType const* t, DumpNode const* dn) { this->OutputElaboratedTypeImpl(t, dn); } void OutputTemplateSpecializationType( clang::TemplateSpecializationType const* t, DumpNode const* dn) { this->OutputElaboratedTypeImpl(t, dn); } #else void OutputElaboratedType(clang::ElaboratedType const* t, DumpNode const* dn) { this->OutputElaboratedTypeImpl(t, dn); } #endif template void OutputElaboratedTypeImpl(T 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 comments to be referenced. unsigned int CommentCount = 0; // 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; #if LLVM_VERSION_MAJOR >= 22 // Memoize ConsolidateType results. typedef std::map ConsolidatedTypeMap; ConsolidatedTypeMap ConsolidatedType; #endif // 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; // Comment traversal queue. std::queue CommentQueue; // 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 declarations our output formats do not support. if (clang::FunctionDecl const* fd = clang::dyn_cast(d)) { if (fd->isDeleted()) { return DumpId(); } if (fd->getLiteralIdentifier()) { return DumpId(); } if (this->Opts.GccXml) { 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 (this->Opts.GccXml) { 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) { #if LLVM_VERSION_MAJOR >= 22 dt.Type = this->ConsolidateType(dt.Type); #endif 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: { auto const* at = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(at->getAdjustedType(), c), complete, dq); } break; case clang::Type::Attributed: { auto const* at = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(at->getEquivalentType(), c), complete, dq); } break; case clang::Type::Auto: { auto const* at = static_cast(t.getTypePtr()); if (at->isSugared()) { return this->AddTypeDumpNode(DumpType(at->desugar(), c), complete, dq); } } break; case clang::Type::Decayed: { auto const* dt = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(dt->getDecayedType(), c), complete, dq); } break; case clang::Type::Decltype: { if (this->Opts.CastXml) { auto const* dtt = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(dtt->getUnderlyingType(), c), complete, dq); } } break; #if LLVM_VERSION_MAJOR < 22 case clang::Type::Elaborated: { auto const* et = static_cast(t.getTypePtr()); if (this->Opts.GccXml || !this->IsElaboratedType(et)) { // The gccxml format does not include ElaboratedType elements, // so replace this one with the underlying type. Note that this // can cause duplicate PointerType and ReferenceType elements // to appear in the output: each copy corresponds to a different // ElaboratedType, but the gccxml format cannot express this. return this->AddTypeDumpNode(DumpType(et->getNamedType(), c), complete, dq); } } break; #endif case clang::Type::Enum: { auto const* et = static_cast(t.getTypePtr()); if (this->Opts.GccXml || !this->IsElaboratedType(et)) { return this->AddDeclDumpNodeForType(et->getDecl(), complete, dq); } } break; case clang::Type::Paren: { auto const* pt = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(pt->getInnerType(), c), complete, dq); } break; #if LLVM_VERSION_MAJOR >= 22 case clang::Type::PredefinedSugar: { clang::PredefinedSugarType const* st = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(st->desugar(), c), complete, dq); } break; #endif case clang::Type::Record: { auto const* rt = static_cast(t.getTypePtr()); if (this->Opts.GccXml || !this->IsElaboratedType(rt)) { return this->AddDeclDumpNodeForType(rt->getDecl(), complete, dq); } } break; case clang::Type::SubstTemplateTypeParm: { auto const* st = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(st->getReplacementType(), c), complete, dq); } break; case clang::Type::TemplateSpecialization: { auto const* tst = static_cast(t.getTypePtr()); if (this->Opts.GccXml || !this->IsElaboratedType(tst)) { if (tst->isSugared()) { return this->AddTypeDumpNode(DumpType(tst->desugar(), c), complete, dq); } } } break; case clang::Type::Typedef: { auto const* tdt = static_cast(t.getTypePtr()); 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; } } } if (this->Opts.GccXml || !this->IsElaboratedType(tdt)) { return this->AddDeclDumpNodeForType(tdt->getDecl(), complete, dq); } } break; #if LLVM_VERSION_MAJOR >= 14 case clang::Type::Using: { auto const* ut = static_cast(t.getTypePtr()); return this->AddTypeDumpNode(DumpType(ut->desugar(), c), complete, dq); } break; #endif 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; } #if LLVM_VERSION_MAJOR >= 22 clang::QualType ASTVisitor::ConsolidateType(clang::QualType t) { clang::Type const* oldTy = t.getTypePtr(); clang::Type const*& newTy = this->ConsolidatedType[oldTy]; if (!newTy) { newTy = this->ConsolidateTypeImpl(oldTy); assert(newTy != nullptr); } return clang::QualType(newTy, t.getLocalFastQualifiers()); } clang::Type const* ASTVisitor::ConsolidateTypeImpl(clang::Type const* t) { switch (t->getTypeClass()) { case clang::Type::LValueReference: { auto const* rt = static_cast(t); clang::QualType oldPointeeType = rt->getPointeeType(); clang::QualType newPointeeType = this->ConsolidateType(oldPointeeType); if (newPointeeType != oldPointeeType) { return this->CTX.getLValueReferenceType(newPointeeType).getTypePtr(); } } break; case clang::Type::Pointer: { auto const* pt = static_cast(t); clang::QualType oldPointeeType = pt->getPointeeType(); clang::QualType newPointeeType = this->ConsolidateType(oldPointeeType); if (newPointeeType != oldPointeeType) { return this->CTX.getPointerType(newPointeeType).getTypePtr(); } } break; case clang::Type::RValueReference: { auto const* rt = static_cast(t); clang::QualType oldPointeeType = rt->getPointeeType(); clang::QualType newPointeeType = this->ConsolidateType(oldPointeeType); if (newPointeeType != oldPointeeType) { return this->CTX.getRValueReferenceType(newPointeeType).getTypePtr(); } } break; case clang::Type::Record: { auto const* rt = static_cast(t); // Clang allocates separate RecordType instances for a record decl // and its injected class name. Replace the latter with the former. if (rt->isInjected()) { if (auto const* rd = clang::dyn_cast(rt->getDecl())) { if (rd->isInjectedClassName()) { rd = static_cast(rd->getDeclContext()); } return this->CTX .getTagType(rt->getKeyword(), rt->getQualifier(), rd, false) .getTypePtr(); } } } break; default: break; } return t; } #endif 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(cx::FileEntryRef 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::ProcessCommentQueue() { while (!this->CommentQueue.empty()) { CommentEntry c = this->CommentQueue.front(); this->CommentQueue.pop(); this->OS << " OS << " attached=\"_" << c.Attached->Index << "\""; } clang::SourceLocation bl = c.Comment->getSourceRange().getBegin(); clang::SourceLocation el = c.Comment->getSourceRange().getEnd(); if (bl.isValid() && el.isValid()) { clang::FullSourceLoc bfl = this->CTX.getFullLoc(bl).getExpansionLoc(); clang::FullSourceLoc efl = this->CTX.getFullLoc(el).getExpansionLoc(); clang::SourceManager const& sm = this->CI.getSourceManager(); clang::FileID bid = bfl.getFileID(); clang::FileID eid = efl.getFileID(); cx::OptionalFileEntryRef bf = this->getFileEntryRefForID(bid); cx::OptionalFileEntryRef ef = this->getFileEntryRefForID(eid); if (bf && bf == ef) { unsigned int fi = this->AddDumpFile(*bf); unsigned int boff = sm.getFileOffset(bfl); unsigned int eoff = sm.getFileOffset(efl); /* clang-format off */ this->OS << " file=\"f" << fi << "\"" " begin_line=\"" << sm.getLineNumber(bid, boff) << "\"" " begin_column=\"" << sm.getColumnNumber(bid, boff) << "\"" " begin_offset=\"" << boff << "\"" " end_line=\"" << sm.getLineNumber(eid, eoff) << "\"" " end_column=\"" << sm.getColumnNumber(eid, eoff) << "\"" " end_offset=\"" << eoff << "\"" ; /* clang-format on */ } } this->OS << "/>\n"; } } void ASTVisitor::ProcessFileQueue() { if (this->FileBuiltin) { /* clang-format off */ this->OS << " ") << "\"/>\n" ; /* clang-format on */ } while (!this->FileQueue.empty()) { cx::FileEntryRef f = this->FileQueue.front(); this->FileQueue.pop(); /* clang-format off */ this->OS << " FileNodes[f] << "\"" " name=\"" << encodeXML(this->getNameOfFileEntryRef(f)) << "\"" "/>\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; #if LLVM_VERSION_MAJOR >= 10 # include "clang/AST/TypeNodes.inc" #else # include "clang/AST/TypeNodes.def" #endif } } } 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 = name; n = stringReplace(n, "__castxml__float128_s", "__float128"); n = stringReplace(n, "__castxml_Float32_s", "_Float32"); n = stringReplace(n, "__castxml_Float32x_s", "_Float32x"); n = stringReplace(n, "__castxml_Float64_s", "_Float64"); n = stringReplace(n, "__castxml_Float64x_s", "_Float64x"); n = stringReplace(n, "__castxml_Float128_s", "_Float128"); this->OS << " name=\"" << encodeXML(n) << "\""; } void ASTVisitor::PrintNameAttribute(llvm::StringRef name) { this->PrintNameAttribute(std::string(name)); } 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); } // We cannot mangle some types correctly because Clang does not have // them as internal types, so skip mangled attributes involving them. if (s.find("__castxml") != std::string::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::QualType ty = this->CTX.getTypeDeclType(td); 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::PrintInitAttribute(clang::Expr const* init) { if (!init) { return; } 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 << "\""; } 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 (cx::OptionalFileEntryRef f = this->getFileEntryRefForID(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=\""; char const* 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=\""; char const* 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=\""; char const* 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) { std::string annotationXML; for (auto const* a : d->specific_attrs()) { attrs.push_back("annotate(" + a->getAnnotation().str() + ")"); if (!annotationXML.empty()) { // Separate annotations by a newline. annotationXML += " "; // LF } annotationXML += encodeXML(a->getAnnotation().str()); } if (d->hasAttr()) { if (this->Opts.CastXml) { this->OS << " annotation=\"" << annotationXML << "\""; } } if (d->hasAttr()) { attrs.push_back("deprecated"); if (this->Opts.CastXml) { clang::DeprecatedAttr* depAttr = d->getAttr(); if (!depAttr->getMessage().empty()) { std::string depMsgText = std::string(depAttr->getMessage()); this->OS << " deprecation=\"" << encodeXML(depMsgText) << "\""; } } } if (d->hasAttr()) { attrs.push_back("dllexport"); } if (d->hasAttr()) { attrs.push_back("dllimport"); } if (d->hasAttr()) { attrs.push_back("final"); } if (d->hasAttr()) { attrs.push_back("override"); } } 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=\""; char const* 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=\""; char const* 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 << "\""; } } void ASTVisitor::PrintCommentAttribute(clang::Decl const* d, DumpNode const* dn) { if (!this->Opts.CastXml) { return; } if (clang::RawComment const* rc = this->CTX.getRawCommentForDeclNoCache(d)) { unsigned int index = ++this->CommentCount; CommentEntry e = { index, rc, dn }; this->CommentQueue.push(e); this->OS << " comment=\"c" << index << "\""; } } 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::PrintCastXMLTypedef(clang::TypedefDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); if (d->getName() == "__castxml__float80") { this->OS << " name=\"__float80\" size=\"128\" align=\"128\""; } else if (d->getName() == "__castxml__float128") { this->OS << " name=\"__float128\" size=\"128\" align=\"128\""; } else if (d->getName() == "__castxml_Float32") { this->OS << " name=\"_Float32\" size=\"32\" align=\"32\""; } else if (d->getName() == "__castxml_Float32x") { this->OS << " name=\"_Float32x\" size=\"64\" align=\"64\""; } else if (d->getName() == "__castxml_Float64") { this->OS << " name=\"_Float64\" size=\"64\" align=\"64\""; } else if (d->getName() == "__castxml_Float64x") { this->OS << " name=\"_Float64x\" size=\"128\" align=\"128\""; } else if (d->getName() == "__castxml_Float128") { this->OS << " name=\"_Float128\" size=\"128\" align=\"128\""; } this->OS << "/>\n"; } bool ASTVisitor::IsCastXMLTypedefType(clang::QualType t) const { #if LLVM_VERSION_MAJOR < 22 if (t->getTypeClass() == clang::Type::Elaborated) { auto const* et = static_cast(t.getTypePtr()); t = et->getNamedType(); } #endif if (t->getTypeClass() == clang::Type::Typedef) { auto const* tdt = static_cast(t.getTypePtr()); if (clang::TypedefDecl const* td = clang::dyn_cast(tdt->getDecl())) { return this->IsCastXMLTypedefDecl(td); } } return false; } bool ASTVisitor::IsCastXMLTypedefDecl(clang::TypedefDecl const* td) const { if (td->getName().starts_with("__castxml") && clang::isa(td->getDeclContext())) { clang::SourceLocation sl = td->getLocation(); if (sl.isValid()) { clang::FullSourceLoc fsl = this->CTX.getFullLoc(sl).getExpansionLoc(); return !this->CI.getSourceManager().getFileEntryForID(fsl.getFileID()); } } return false; } void ASTVisitor::OutputFunctionHelper(clang::FunctionDecl const* d, DumpNode const* dn, char const* tag, unsigned int flags, cx::optional const& name) { this->OS << " <" << tag; this->PrintIdAttribute(dn); if (name) { this->PrintNameAttribute(*name); } 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=\""; char const* 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) && d->getLanguageLinkage() == clang::CXXLanguageLinkage) { this->PrintMangledAttribute(d); } this->GetFunctionTypeAttributes(fpt, attributes); } this->GetDeclAttributes(d, attributes); this->PrintAttributesAttribute(attributes); this->PrintCommentAttribute(d, dn); 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, char const* 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(std::string("::")); 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->PrintCommentAttribute(d, dn); this->OS << "/>\n"; } void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d, DumpNode const* dn) { char const* tag; switch (d->getTagKind()) { case cx_TagTypeKind(Class): tag = "Class"; break; case cx_TagTypeKind(Union): tag = "Union"; break; case cx_TagTypeKind(Struct): tag = "Struct"; break; case cx_TagTypeKind(Interface): return; case cx_TagTypeKind(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); if (d->getIdentifier()) { 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); this->PrintCommentAttribute(d, dn); 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 types // with FundamentalType to pretend we had a builtin type. if (this->IsCastXMLTypedefDecl(d)) { this->PrintCastXMLTypedef(d, 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->PrintCommentAttribute(d, dn); 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->PrintCommentAttribute(d, dn); 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); if (this->Opts.CastXml) { this->PrintTypeAttribute(d->getIntegerType(), dn->Complete); } this->PrintContextAttribute(d); this->PrintLocationAttribute(d); if (this->Opts.CastXml && d->isScoped()) { this->OS << " scoped=\"1\""; } this->PrintABIAttributes(d); this->PrintAttributesAttribute(d); this->PrintCommentAttribute(d, dn); 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( #if LLVM_VERSION_MAJOR < 20 this->CTX #endif ); this->OS << " bits=\"" << bits << "\""; } if (this->Opts.CastXml && !this->IsCastXMLTypedefType(d->getType())) { this->PrintInitAttribute(d->getInClassInitializer()); } this->PrintContextAttribute(d); this->PrintLocationAttribute(d); this->PrintOffsetAttribute(this->CTX.getFieldOffset(d)); if (d->isMutable()) { this->OS << " mutable=\"1\""; } this->PrintAttributesAttribute(d); this->PrintCommentAttribute(d, dn); 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 (!this->IsCastXMLTypedefType(d->getType())) { this->PrintInitAttribute(d->getInit()); } 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\""; } bool const isTranslationUnit = clang::isa(d->getDeclContext()); if (!isTranslationUnit) { // FIXME: Recognize 'extern "C" int var;' inside a namespace. this->PrintMangledAttribute(d); } this->PrintAttributesAttribute(d); this->PrintCommentAttribute(d, dn); 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->isPureVirtual()) { 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->isPureVirtual()) { 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->isPureVirtual()) { flags |= FH_Pure; } this->OutputFunctionHelper(d, dn, "Destructor", flags, this->GetContextName(d)); } void ASTVisitor::OutputAtomicType(clang::AtomicType const* t, DumpNode const* dn) { if (this->Opts.GccXml) { this->OutputUnimplementedType(t, dn); return; } this->OS << " PrintIdAttribute(dn); this->PrintTypeAttribute(t->getValueType(), false); this->PrintABIAttributes(this->CTX.getTypeInfo(t)); this->OS << "/>\n"; } void ASTVisitor::OutputAutoType(clang::AutoType const* t, DumpNode const* dn) { if (this->Opts.GccXml) { this->OutputUnimplementedType(t, dn); return; } this->OS << " PrintIdAttribute(dn); this->OS << "/>\n"; } 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::OutputRValueReferenceType(clang::RValueReferenceType 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) { clang::Type const* c = #if LLVM_VERSION_MAJOR >= 21 cx::deref(t->getQualifier()).getAsType() #else t->getClass() #endif ; if (t->isMemberDataPointerType()) { this->OutputOffsetType(t->getPointeeType(), c, dn); } else { this->OS << " PrintIdAttribute(dn); DumpId id = this->AddTypeDumpNode(DumpType(t->getPointeeType(), c), 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"; } template void ASTVisitor::OutputElaboratedTypeImpl(T const* t, DumpNode const* dn) { assert(this->IsElaboratedType(t)); this->OS << " PrintIdAttribute(dn); if (cx::NestedNameSpecifier nns = this->GetElaboratedTypeQualifier(t)) { std::string s; llvm::raw_string_ostream rso(s); cx::deref(nns).print(rso, this->PrintingPolicy); this->OS << " qualifier=\"" << encodeXML(rso.str()) << '"'; } clang::ElaboratedTypeKeyword k = this->GetElaboratedTypeKeyword(t); if (k != cx_ElaboratedTypeKeyword(None)) { this->OS << " keyword=\"" << encodeXML(clang::TypeWithKeyword::getKeywordName(k).str()) << '"'; } this->PrintTypeAttribute(this->GetElaboratedTypeNamed(t), dn->Complete); 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 comment queue. this->ProcessCommentQueue(); // 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-CastXML-892090e/src/Output.h000066400000000000000000000016721514765374600170100ustar00rootroot00000000000000/* 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 https://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-CastXML-892090e/src/RunClang.cxx000066400000000000000000001146501514765374600175750ustar00rootroot00000000000000/* 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 https://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" #if LLVM_VERSION_MAJOR >= 17 # include "llvm/TargetParser/Host.h" #else # include "llvm/Support/Host.h" #endif #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/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/Path.h" #include "llvm/Support/raw_ostream.h" #if LLVM_VERSION_MAJOR >= 22 # include "clang/Options/Options.h" # define CASTXML_CLANG_OPTIONS clang::options #else # include "clang/Driver/Options.h" # define CASTXML_CLANG_OPTIONS clang::driver::options #endif #if LLVM_VERSION_MAJOR >= 20 # include "llvm/Support/VirtualFileSystem.h" #endif #include #include #include #include #include #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9 # define CASTXML_OWNS_OSTREAM #endif #if LLVM_VERSION_MAJOR >= 10 # define CASTXML_MAKE_UNIQUE std::make_unique #else # define CASTXML_MAKE_UNIQUE llvm::make_unique #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); } }; #define UNDEF_FLT(x) \ "#undef __" #x "_DECIMAL_DIG__\n" \ "#undef __" #x "_DENORM_MIN__\n" \ "#undef __" #x "_DIG__\n" \ "#undef __" #x "_EPSILON__\n" \ "#undef __" #x "_HAS_DENORM__\n" \ "#undef __" #x "_HAS_INFINITY__\n" \ "#undef __" #x "_HAS_QUIET_NAN__\n" \ "#undef __" #x "_IS_IEC_60559__\n" \ "#undef __" #x "_MANT_DIG__\n" \ "#undef __" #x "_MAX_10_EXP__\n" \ "#undef __" #x "_MAX_EXP__\n" \ "#undef __" #x "_MAX__\n" \ "#undef __" #x "_MIN_10_EXP__\n" \ "#undef __" #x "_MIN_EXP__\n" \ "#undef __" #x "_MIN__\n" \ "#undef __" #x "_NORM_MAX__\n" \ "" 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; // Remove GCC builtin definitions for features Clang does not implement. if (this->IsActualGNU(this->Opts.Predefines)) { builtins += UNDEF_FLT(BFLT16); builtins += UNDEF_FLT(FLT32); builtins += UNDEF_FLT(FLT32X); builtins += UNDEF_FLT(FLT64); builtins += UNDEF_FLT(FLT64X); builtins += UNDEF_FLT(FLT128); builtins += "#undef __STDCPP_BFLOAT16_T__\n" "#undef __STDCPP_FLOAT128_T__\n" "#undef __STDCPP_FLOAT16_T__\n" "#undef __STDCPP_FLOAT32_T__\n" "#undef __STDCPP_FLOAT64_T__\n"; } // 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 __float80 if simulating the actual GNU compiler. if (this->NeedFloat80(this->Opts.Predefines)) { // Clang does not support this builtin. Approximate it. builtins += "\n" "typedef long double __castxml__float80;\n" "#define __float80 __castxml__float80\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"; } if (CI.getLangOpts().MSCompatibilityVersion >= 192300000) { // MSVC tools 14.23 and above declare __builtin_assume_aligned // in "intrin0.h" with a signature incompatible with Clang's // builtin. It is guarded by '!defined(__clang__)' but that // breaks when we simulate MSVC's preprocessor. Rename the // builtin via preprocessing to avoid the conflict. builtins += "\n" "#define __builtin_assume_aligned" " __castxml__builtin_assume_aligned\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"; } // Tolerate glibc use of a GNU extension not implemented by Clang. if (this->NeedAttributeMallocArgs(this->Opts.Predefines)) { // Clang does not support '__attribute__((__malloc__(args...)))' // used in glibc 2.34+ headers. builtins += "\n" "#define __malloc__(...) __malloc__\n"; } if (this->NeedAttributeAssumeSuppression(this->Opts.Predefines)) { // Clang does not support '__attribute__((__assume__(args...)))' // as a statement attribute used in libstdc++ headers. builtins += "\n" "#define __assume__(...)\n"; } // Clang's arm_neon.h checks for a feature macro not defined by GCC. if (this->NeedARMv8Intrinsics(this->Opts.Predefines)) { builtins += "\n" "#define __ARM_FEATURE_DIRECTED_ROUNDING 1\n"; } // Provide _Float## types if simulating the actual GNU compiler. if (this->Need_Float(this->Opts.Predefines)) { // Clang does not have these types for all sizes. // Provide our own approximation of the builtins. builtins += "\n" "#define _Float32 __castxml_Float32\n" "#define _Float32x __castxml_Float32x\n" "#define _Float64 __castxml_Float64\n" "#define _Float64x __castxml_Float64x\n"; if (this->NeedFloat128(this->Opts.Predefines)) { builtins += "#define _Float128 __castxml_Float128\n"; } if (this->IsCPlusPlus(this->Opts.Predefines)) { // In C++ we need distinct types for template specializations // in glibc headers, but also need conversions. builtins += "\n" "typedef struct __castxml_Float32_s { " " float x; " " operator float() const; " " __castxml_Float32_s(float); " "} __castxml_Float32;\n" "typedef struct __castxml_Float32x_s { " " double x; " " operator double() const; " " __castxml_Float32x_s(double); " "} __castxml_Float32x;\n" "typedef struct __castxml_Float64_s { " " double x; " " operator double() const; " " __castxml_Float64_s(double); " "} __castxml_Float64;\n" "typedef struct __castxml_Float64x_s { " " long double x; " " operator long double() const; " " __castxml_Float64x_s(long double); " "} __castxml_Float64x;\n"; if (this->NeedFloat128(this->Opts.Predefines)) { builtins += "typedef struct __castxml_Float128_s { " " __float128 x; " " operator __float128() const; " " __castxml_Float128_s(__float128); " "} __castxml_Float128;\n"; } } else { // In C we need real float types for conversions in glibc headers. builtins += "\n" "typedef float __castxml_Float32;\n" "typedef double __castxml_Float32x;\n" "typedef double __castxml_Float64;\n" "typedef long double __castxml_Float64x;\n"; if (this->NeedFloat128(this->Opts.Predefines)) { builtins += "typedef __float128 __castxml_Float128;\n"; } } } } else { builtins += predefines.substr(start, end - start); } return predefines.substr(0, start) + builtins + predefines.substr(end); } bool IsCPlusPlus(std::string const& pd) const { return pd.find("#define __cplusplus ") != pd.npos; } 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); } unsigned int GetGNUMajorVersion(std::string const& pd) const { if (char const* d = strstr(pd.c_str(), "#define __GNUC__ ")) { d += 17; if (char const* e = strchr(d, '\n')) { if (*(e - 1) == '\r') { --e; } std::string const ver_str(d, e - d); errno = 0; long ver = std::strtol(ver_str.c_str(), nullptr, 10); if (errno == 0 && ver > 0) { return static_cast(ver); } } } return 0; } bool NeedBuiltinVarArgPack(std::string const& pd) { return this->IsActualGNU(pd); } bool NeedAttributeMallocArgs(std::string const& pd) { return this->IsActualGNU(pd); } bool NeedAttributeAssumeSuppression(std::string const& pd) { return this->IsActualGNU(pd); } bool NeedFloat80(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 NeedFloat128(std::string const& pd) const { return this->NeedFloat80(pd); } 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 } bool Need_Float(std::string const& pd) const { if (this->IsActualGNU(pd)) { // gcc >= 7 provides _Float## types in C. if (!this->IsCPlusPlus(pd)) { return this->GetGNUMajorVersion(pd) >= 7; } // g++ >= 13 provides _Float## types in C++. if (this->GetGNUMajorVersion(pd) < 13) { return false; } // glibc 2.27 added bits/floatn-common.h to define _Float## types when // the compiler does not, but only knew about GCC 7+ _Float## types in C. // glibc 2.37 updated the conditions for GCC 13+ _Float## types in C++. for (Options::Include const& i : this->Opts.Includes) { if (i.Framework) { continue; } if (std::ifstream f{ i.Directory + "/bits/floatn-common.h" }) { std::string h{ std::istreambuf_iterator(f), std::istreambuf_iterator() }; // If the header contains the pre-2.37 condition then // let it handle defining the _Float## types. if (h.find("if !__GNUC_PREREQ (7, 0) || defined __cplusplus") != std::string::npos) { return false; } break; } } return true; } return false; } #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 NeedARMv8Intrinsics(std::string const& pd) { if (char const* d = strstr(pd.c_str(), "#define __ARM_ARCH ")) { d += 19; if (pd.find("#define __ARM_FEATURE_DIRECTED_ROUNDING ") != pd.npos) { return false; } if (char const* e = strchr(d, '\n')) { if (*(e - 1) == '\r') { --e; } std::string const arm_arch_str(d, e - d); errno = 0; long arm_arch = std::strtol(arm_arch_str.c_str(), nullptr, 10); if (errno == 0 && arm_arch >= 8) { return true; } } } return false; } bool BeginSourceFileAction(clang::CompilerInstance& CI #if LLVM_VERSION_MAJOR < 5 , llvm::StringRef /*Filename*/ #endif ) override { CI.getPreprocessor().setPredefines(this->UpdatePredefines(CI)); 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 CASTXML_MAKE_UNIQUE(CI, std::move(OS), this->Opts); #else } else if (llvm::raw_ostream* OS = CI.createDefaultOutputFile(false, filename(InFile), "xml")) { return CASTXML_MAKE_UNIQUE(CI, *OS, this->Opts); #endif } else { return nullptr; } } protected: bool BeginSourceFileAction(clang::CompilerInstance& CI #if LLVM_VERSION_MAJOR < 5 , llvm::StringRef Filename #endif ) override { this->CastXMLPredefines::BeginSourceFileAction(CI #if LLVM_VERSION_MAJOR < 5 , Filename #endif ); // Tell Clang not to tear down the parser at EOF. // We need it in ASTConsumer::HandleTranslationUnit. CI.getPreprocessor().enableIncrementalProcessing(); return true; } 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 LLVM_VERSION_MAJOR >= 20 && LLVM_VERSION_MAJOR < 22 *llvm::vfs::getRealFileSystem() #endif ); 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 int runClangImpl(char const* const* argBeg, char const* const* argEnd, Options const& opts) { // Construct a diagnostics engine for use while processing driver options. #if LLVM_VERSION_MAJOR >= 21 clang::DiagnosticOptions diagOpts; clang::DiagnosticOptions& diagOptsRef = diagOpts; clang::DiagnosticOptions& diagOptsPtr = diagOpts; #else llvm::IntrusiveRefCntPtr diagOpts( new clang::DiagnosticOptions); clang::DiagnosticOptions& diagOptsRef = *diagOpts; clang::DiagnosticOptions* diagOptsPtr = &diagOptsRef; #endif llvm::IntrusiveRefCntPtr diagID( new clang::DiagnosticIDs()); #if LLVM_VERSION_MAJOR >= 22 llvm::opt::OptTable const* driverOpts = &clang::getDriverOptTable(); #elif LLVM_VERSION_MAJOR >= 10 llvm::opt::OptTable const* driverOpts = &clang::driver::getDriverOptTable(); #else std::unique_ptr driverOpts( clang::driver::createDriverOptTable()); #endif unsigned missingArgIndex, missingArgCount; #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7 llvm::opt::InputArgList args(driverOpts->ParseArgs( # if LLVM_VERSION_MAJOR >= 16 llvm::ArrayRef(argBeg, argEnd), # else llvm::makeArrayRef(argBeg, argEnd), # endif missingArgIndex, missingArgCount)); clang::ParseDiagnosticArgs(diagOptsRef, args); #else std::unique_ptr args( driverOpts->ParseArgs(argBeg, argEnd, missingArgIndex, missingArgCount)); clang::ParseDiagnosticArgs(diagOptsRef, *args); #endif clang::TextDiagnosticPrinter diagClient(llvm::errs(), diagOptsPtr); clang::DiagnosticsEngine diags(diagID, diagOptsPtr, &diagClient, /*ShouldOwnClient=*/false); clang::ProcessWarningOptions(diags, diagOptsRef, #if LLVM_VERSION_MAJOR >= 20 *llvm::vfs::getRealFileSystem(), #endif /*ReportDiags=*/false); // 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(CASTXML_CLANG_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()); char const* const* cmdArgBeg = cmd->getArguments().data(); char const* const* cmdArgEnd = cmdArgBeg + cmd->getArguments().size(); if (clang::CompilerInvocation::CreateFromArgs( CI->getInvocation(), #if LLVM_VERSION_MAJOR >= 16 llvm::ArrayRef(cmdArgBeg, cmdArgEnd), #elif LLVM_VERSION_MAJOR >= 10 llvm::makeArrayRef(cmdArgBeg, cmdArgEnd), #else cmdArgBeg, cmdArgEnd, #endif 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(char const* const* argBeg, char const* 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 __cpp_sized_deallocation ") != std::string::npos) { args.emplace_back("-fsized-deallocation"); } if (pd.find("#define _MSC_EXTENSIONS ") != pd.npos) { args.push_back("-fms-extensions"); } if (char const* 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 (char const* 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 (char const* l = strstr(pd.c_str(), "#define _MSVC_LANG ")) { l += 19; if (char const* 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 >= 202302L) { #if LLVM_VERSION_MAJOR >= 17 args.push_back("-std=c++23"); #elif LLVM_VERSION_MAJOR >= 11 args.push_back("-std=c++20"); #else args.push_back("-std=c++17"); #endif } else if (msvc_lang >= 202002L) { #if LLVM_VERSION_MAJOR >= 11 args.push_back("-std=c++20"); #else args.push_back("-std=c++17"); #endif } else 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 (char const* 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 (char const* 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 >= 202302L) { #if LLVM_VERSION_MAJOR >= 17 std_flag += "23"; #elif LLVM_VERSION_MAJOR >= 11 std_flag += "20"; #elif LLVM_VERSION_MAJOR >= 5 std_flag += "17"; #else std_flag += "1z"; #endif } else if (std_date >= 202002L) { #if LLVM_VERSION_MAJOR >= 11 std_flag += "20"; #elif LLVM_VERSION_MAJOR >= 5 std_flag += "17"; #else std_flag += "1z"; #endif } else 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 (char const* d = strstr(pd.c_str(), "#define __STDC_VERSION__ ")) { // Extract the C standard level. d += 25; if (char const* 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-CastXML-892090e/src/RunClang.h000066400000000000000000000015251514765374600172160ustar00rootroot00000000000000/* 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 https://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(char const* const* argBeg, char const* const* argEnd, Options const& opts); #endif // CASTXML_RUNCLANG_H CastXML-CastXML-892090e/src/SourceDir.txt.in000066400000000000000000000000251514765374600203730ustar00rootroot00000000000000@CastXML_SOURCE_DIR@ CastXML-CastXML-892090e/src/Utils.cxx000066400000000000000000000163741514765374600171700ustar00rootroot00000000000000/* 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 https://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 "llvm/Config/llvm-config.h" #include #if LLVM_VERSION_MAJOR >= 16 # include #else # include #endif #include #include #include #include #include #include static std::string castxmlResourceDir; static std::string castxmlClangResourceDir; static std::string GetMainExecutable(char const* 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(char const* 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(std::string(dir.str())) && !tryBuildDir(std::string(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, char const* const* argv, int& ret, std::string& out, std::string& err, std::string& msg, std::string* maybeTmpDir) { // 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 (maybeTmpDir) { tmpDir = *maybeTmpDir; } else 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 >= 16 std::optional redirects[3]; redirects[0] = inFile; redirects[1] = outFile; redirects[2] = errFile; #elif 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; #else std::vector cmd(argv, argv + argc); cmd.push_back(0); char const** args = &*cmd.begin(); #endif #if LLVM_VERSION_MAJOR >= 16 std::optional> env = std::nullopt; #elif LLVM_VERSION_MAJOR >= 7 llvm::Optional> env = llvm::None; #else char const** 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)); if (!maybeTmpDir) { llvm::sys::fs::remove(llvm::Twine(tmpDir)); } return ret >= 0; } std::string encodeXML(std::string const& in, bool cdata) { std::string xml; char const* last = in.c_str(); for (char const* 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-CastXML-892090e/src/Utils.h000066400000000000000000000041121514765374600166000ustar00rootroot00000000000000/* 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 https://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 /// findResourceDir - 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(char const* 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, char const* const* argv, int& ret, std::string& out, std::string& err, std::string& msg, std::string* maybeTmpDir = nullptr); /// 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-CastXML-892090e/src/Version.cmake000066400000000000000000000042411514765374600177610ustar00rootroot00000000000000# CastXML version number components. set(CastXML_VERSION_MAJOR 0) set(CastXML_VERSION_MINOR 7) 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(DEFINED CastXML_VERSION_RC) set(CastXML_VERSION "${CastXML_VERSION}-rc${CastXML_VERSION_RC}") endif() # If this source was exported by 'git archive', use its commit info. set(git_info "2d52b47c CastXML 0.7.0") # Otherwise, try to identify the current development source version. if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " AND 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() # 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}") endif() endif() # Extract commit information if available. if(git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[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(CastXML_VERSION "${CastXML_VERSION}-g${git_hash}") 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-CastXML-892090e/src/Version.h.in000066400000000000000000000015471514765374600175430ustar00rootroot00000000000000/* 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 https://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-CastXML-892090e/src/castxml.cxx000066400000000000000000000251031514765374600175310ustar00rootroot00000000000000/* 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 https://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: char const* SaveString(char const* s) { return this->Strings.insert(s).first->c_str(); } }; #endif int main(int argc_in, char const** 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; char const* 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-CastXML-892090e/src/clang-format.bash000077500000000000000000000062671514765374600205600ustar00rootroot00000000000000#!/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 # # https://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-18 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' '*.c' '*.cxx' | egrep -z -v '^share/castxml/' | egrep -z -v '^src/kwsys/' | # Update sources in-place. xargs -0 "$clang_format" -i CastXML-CastXML-892090e/test/000077500000000000000000000000001514765374600155215ustar00rootroot00000000000000CastXML-CastXML-892090e/test/CMakeLists.txt000066400000000000000000001072761514765374600202760ustar00rootroot00000000000000#============================================================================= # 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 # # https://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(_schema "${CastXML_SOURCE_DIR}/doc/manual/castxml.xsd") 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}" "-Dschema=${_schema}" -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_cxx20 test) castxml_test_output_common(gccxml cxx c++20 ${test}) castxml_test_output_common(castxml1 cxx c++20 ${test}) endmacro() macro(castxml_test_output_gnuxx20 test) castxml_test_output_common(gccxml cxx gnu++20 ${test}) castxml_test_output_common(castxml1 cxx gnu++20 ${test}) endmacro() macro(castxml_test_output_cxx23 test) castxml_test_output_common(gccxml cxx c++23 ${test}) castxml_test_output_common(castxml1 cxx c++23 ${test}) endmacro() macro(castxml_test_output_gnuxx23 test) castxml_test_output_common(gccxml cxx gnu++23 ${test}) castxml_test_output_common(castxml1 cxx gnu++23 ${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_broken_cxx20 test) castxml_test_output_common(gccxml.broken cxx c++20 ${test}) castxml_test_output_common(castxml1.broken cxx c++20 ${test}) endmacro() macro(castxml_test_output_broken_gnuxx20 test) castxml_test_output_common(gccxml.broken cxx gnu++20 ${test}) castxml_test_output_common(castxml1.broken cxx gnu++20 ${test}) endmacro() macro(castxml_test_output_broken_cxx23 test) castxml_test_output_common(gccxml.broken cxx c++23 ${test}) castxml_test_output_common(castxml1.broken cxx c++23 ${test}) endmacro() macro(castxml_test_output_broken_gnuxx23 test) castxml_test_output_common(gccxml.broken cxx gnu++23 ${test}) castxml_test_output_common(castxml1.broken cxx gnu++23 ${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}) if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_output_cxx20(${test}) castxml_test_output_gnuxx20(${test}) endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_output_cxx23(${test}) castxml_test_output_gnuxx23(${test}) endif() 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}) if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_output_cxx20(${test}) castxml_test_output_gnuxx20(${test}) endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_output_cxx23(${test}) castxml_test_output_gnuxx23(${test}) endif() 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}) if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_output_cxx20(${test}) castxml_test_output_gnuxx20(${test}) endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_output_cxx23(${test}) castxml_test_output_gnuxx23(${test}) endif() 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}) if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_output_broken_cxx20(${test}) castxml_test_output_broken_gnuxx20(${test}) endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_output_broken_cxx23(${test}) castxml_test_output_broken_gnuxx23(${test}) endif() 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() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_cmd(gccxml-and-c++20 --castxml-gccxml -std=c++20 ${empty_cxx}) castxml_test_cmd(castxml-and-c++20 --castxml-output=1 -std=c++20 ${empty_cxx}) endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_cmd(gccxml-and-c++23 --castxml-gccxml -std=c++23 ${empty_cxx}) castxml_test_cmd(castxml-and-c++23 --castxml-output=1 -std=c++23 ${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) castxml_test_cmd(fbracket-depth -fbracket-depth=300 -std=c11 -c ${input}/fbracket-depth.c) set_property(TEST cmd.fbracket-depth APPEND PROPERTY LABELS LargeStackRequired) # aid exclusion # 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-intrinsics-armv7 --castxml-cc-gnu "(" $ -tgt-armv7 ")" -v ${input}/intrinsics-armv7.cxx) castxml_test_cmd(cc-gnu-intrinsics-arm64v8 --castxml-cc-gnu "(" $ -tgt-arm64v8 ")" -v ${input}/intrinsics-arm64v8.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-aarch64 --castxml-cc-gnu "(" $ --cc-define=__aarch64__ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-amd64 --castxml-cc-gnu "(" $ --cc-define=__amd64__ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-arm --castxml-cc-gnu "(" $ --cc-define=__arm__ ")" ${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() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_cmd(cc-gnu-std-c++20 --castxml-cc-gnu "(" $ -std=202002L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++20 --castxml-cc-gnu "(" $ -std=202002L ")" ${empty_cxx} "-###") endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_cmd(cc-gnu-std-c++23 --castxml-cc-gnu "(" $ -std=202302L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++23 --castxml-cc-gnu "(" $ -std=202302L ")" ${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) castxml_test_cmd(cc-gnu-fsized-deallocation --castxml-cc-gnu "(" $ -fsized-deallocation ")" ${empty_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-aarch64 --castxml-cc-msvc "(" $ --cc-define=_M_ARM64 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-amd64 --castxml-cc-msvc "(" $ --cc-define=_M_AMD64 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-arm --castxml-cc-msvc "(" $ --cc-define=_M_ARM ")" ${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) if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 11) castxml_test_cmd(cc-msvc-std-c++20 --castxml-cc-msvc "(" $ -msc=1930 -msvc_lang=202002L ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++20-E --castxml-cc-msvc "(" $ -msc=1930 -msvc_lang=202002L -stdcpp_default_new_alignment=16ll ")" ${empty_cxx} -E -dM) endif() if(LLVM_VERSION_MAJOR VERSION_GREATER_EQUAL 17) castxml_test_cmd(cc-msvc-std-c++23 --castxml-cc-msvc "(" $ -msc=1944 -msvc_lang=202302L ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++23-E --castxml-cc-msvc "(" $ -msc=1944 -msvc_lang=202302L -stdcpp_default_new_alignment=16ll ")" ${empty_cxx} -E -dM) endif() 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) if(";${LLVM_TARGETS_TO_BUILD};" MATCHES ";X86;") castxml_test_cmd(cc-msvc-builtin-1923 --castxml-cc-msvc "(" $ -msc=1923 --cc-define=_M_X64 ")" ${input}/assume_aligned.cxx) endif() 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(Atomic-int) castxml_test_output(Atomic-int-const) castxml_test_output(Atomic-ptr) castxml_test_output(Atomic-struct) castxml_test_output_c(Atomic-int) castxml_test_output_c(Atomic-int-const) castxml_test_output_c(Atomic-ptr) castxml_test_output_c(Atomic-struct) castxml_test_output(Class) castxml_test_output(Class-abstract) castxml_test_output(Class-annotate) castxml_test_output(Class-deprecated) castxml_test_output(Class-deprecated-long) 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_11(Class-member-injected) 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(Comment-Class) castxml_test_output(Comment-Enumeration) castxml_test_output(Comment-Field) castxml_test_output(Comment-Function) castxml_test_output(Comment-Function-expansion) castxml_test_output(Comment-Function-separated) castxml_test_output(Comment-Method) castxml_test_output(Comment-Namespace) castxml_test_output_11(Comment-TypeAlias) castxml_test_output(Comment-Typedef) castxml_test_output(Comment-Variable) 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_c(Elaborated) castxml_test_output(Elaborated-ns) castxml_test_output(Enumeration) castxml_test_output(Enumeration-annotate) castxml_test_output(Enumeration-annotate-multi) castxml_test_output(Enumeration-deprecated) castxml_test_output(Enumeration-anonymous) castxml_test_output_11(Enumeration-scoped) castxml_test_output_11(Enumeration-type) castxml_test_output(Field) castxml_test_output(Field-annotate) castxml_test_output(Field-deprecated) castxml_test_output_11(Field-init) castxml_test_output(Function) castxml_test_output_c(Function) castxml_test_output_14(Function-auto) castxml_test_output_14(Function-auto-undeduced) castxml_test_output(Function-annotate) castxml_test_output(Function-deprecated) castxml_test_output(Function-extern-C) 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_11(Method-final) castxml_test_output_11(Method-override) 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_c(Variable) castxml_test_output(Variable-annotate) castxml_test_output(Variable-deprecated) castxml_test_output(Variable-extern-C) 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 "(" $ --ver-major=7 ")") castxml_test_output_c(GNU-_Float32) castxml_test_output_c(GNU-_Float32x) castxml_test_output_c(GNU-_Float64) castxml_test_output_c(GNU-_Float64x) set(castxml_test_output_extra_arguments --castxml-cc-gnu-c "(" $ --ver-major=7 --cc-define=__x86_64__ ")") castxml_test_output_c(GNU-_Float128) unset(castxml_test_output_extra_arguments) set(castxml_test_output_extra_arguments --castxml-cc-gnu "(" $ --ver-major=13 ")") castxml_test_output(GNU-_Float32) castxml_test_output(GNU-_Float32x) castxml_test_output(GNU-_Float64) castxml_test_output(GNU-_Float64x) set(castxml_test_output_extra_arguments --castxml-cc-gnu "(" $ --ver-major=13 --cc-define=__x86_64__ ")") castxml_test_output(GNU-_Float128) unset(castxml_test_output_extra_arguments) set(castxml_test_output_extra_arguments --castxml-cc-gnu-c "(" $ --cc-define=__x86_64__ ")") castxml_test_output_c(GNU-__float80) 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-__float80) 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-attr-assume) castxml_test_output_c(GNU-attr-malloc-args) 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-attr-assume) castxml_test_output(GNU-attr-malloc-args) castxml_test_output(GNU-va_arg_pack) unset(castxml_test_output_extra_arguments) CastXML-CastXML-892090e/test/cc-gnu-builtin/000077500000000000000000000000001514765374600203415ustar00rootroot00000000000000CastXML-CastXML-892090e/test/cc-gnu-builtin/emmintrin.h000066400000000000000000000000001514765374600225020ustar00rootroot00000000000000CastXML-CastXML-892090e/test/cc-gnu.c000066400000000000000000000075301514765374600170460ustar00rootroot00000000000000#include #include #define DEFINE_FLT(x) \ "#define __" #x "_DECIMAL_DIG__\n" \ "#define __" #x "_DENORM_MIN__\n" \ "#define __" #x "_DIG__\n" \ "#define __" #x "_EPSILON__\n" \ "#define __" #x "_HAS_DENORM__\n" \ "#define __" #x "_HAS_INFINITY__\n" \ "#define __" #x "_HAS_QUIET_NAN__\n" \ "#define __" #x "_IS_IEC_60559__\n" \ "#define __" #x "_MANT_DIG__\n" \ "#define __" #x "_MAX_10_EXP__\n" \ "#define __" #x "_MAX_EXP__\n" \ "#define __" #x "_MAX__\n" \ "#define __" #x "_MIN_10_EXP__\n" \ "#define __" #x "_MIN_EXP__\n" \ "#define __" #x "_MIN__\n" \ "#define __" #x "_NORM_MAX__\n" \ "" int main(int argc, char const* argv[]) { int cpp = 0; char const* std_date = 0; char const* ver_major = "1"; 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], "--ver-major=", 12) == 0) { ver_major = 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 (strcmp(argv[i], "-fsized-deallocation") == 0) { fprintf(stdout, "#define __cpp_sized_deallocation 201309L\n"); } else if (strcmp(argv[i], "-tgt-armv7") == 0) { fprintf(stdout, "#define __arm__ 1\n"); fprintf(stdout, "#define __ARM_ARCH 7\n"); } else if (strcmp(argv[i], "-tgt-arm64v8") == 0) { fprintf(stdout, "#define __aarch64__ 1\n"); fprintf(stdout, "#define __ARM_ARCH 8\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, #ifdef _WIN32 "#define _WIN32 1\n" "#define __MINGW32__ 1\n" #endif "#define __GNUC__ %s\n" "#define __has_include(x) x\n" "#define __has_include_next(x) x\n" "#define __GNUC_MINOR__ 1\n" "#define __bool __bool\n" "#define __builtin_vsx_foo __builtin_vsx_foo\n" "#define __pixel __pixel\n" "#define __vector __vector\n" "#define __has_last(x) x", ver_major); /* Test GCC builtin definitions for features Clang does not implement. */ fprintf(stdout, DEFINE_FLT(BFLT16)); fprintf(stdout, DEFINE_FLT(FLT32)); fprintf(stdout, DEFINE_FLT(FLT32X)); fprintf(stdout, DEFINE_FLT(FLT64)); fprintf(stdout, DEFINE_FLT(FLT64X)); fprintf(stdout, DEFINE_FLT(FLT128)); fprintf(stdout, "#define __STDCPP_BFLOAT16_T__\n" "#define __STDCPP_FLOAT128_T__\n" "#define __STDCPP_FLOAT16_T__\n" "#define __STDCPP_FLOAT32_T__\n" "#define __STDCPP_FLOAT64_T__\n"); 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-CastXML-892090e/test/cc-msvc.c000066400000000000000000000024161514765374600172230ustar00rootroot00000000000000#include #include int main(int argc, char const* argv[]) { int cpp = 0; char const* msc_ver = "1600"; char const* msvc_lang = 0; char const* 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-CastXML-892090e/test/cc-msvc.cmake000066400000000000000000000000661514765374600200600ustar00rootroot00000000000000set(ENV{INCLUDE} "/some/include;/some/other/include") CastXML-CastXML-892090e/test/expect/000077500000000000000000000000001514765374600170115ustar00rootroot00000000000000CastXML-CastXML-892090e/test/expect/castxml1.any.ArrayType-incomplete.xml.txt000066400000000000000000000005461514765374600267540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*>
    $ CastXML-CastXML-892090e/test/expect/castxml1.any.ArrayType.xml.txt000066400000000000000000000005341514765374600246140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Atomic-int-const.xml.txt000066400000000000000000000006441514765374600260260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Atomic-int.xml.txt000066400000000000000000000005531514765374600247010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Atomic-ptr.xml.txt000066400000000000000000000006531514765374600247150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Atomic-struct.xml.txt000066400000000000000000000007111514765374600254270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.CXXLiteral.xml.txt000066400000000000000000000002061514765374600246470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-abstract.xml.txt000066400000000000000000000031311514765374600255360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-annotate.xml.txt000066400000000000000000000033201514765374600255440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-base-offset.xml.txt000066400000000000000000000156261514765374600261450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-base-typedef.xml.txt000066400000000000000000000063601514765374600263120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-deprecated-long.xml.txt000066400000000000000000000035531514765374600270000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-deprecated.xml.txt000066400000000000000000000033071514765374600260400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-forward.xml.txt000066400000000000000000000020301514765374600253740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-friends.xml.txt000066400000000000000000000037731514765374600254010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-access-mutable.xml.txt000066400000000000000000000033331514765374600317040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-access.xml.txt000066400000000000000000000030041514765374600302500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-array.xml.txt000066400000000000000000000036201514765374600301310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-bad-base.xml.txt000066400000000000000000000052211514765374600304500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> ( | ) ( | ) $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-const-aggregate.xml.txt000066400000000000000000000023541514765374600320700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-const.xml.txt000066400000000000000000000025151514765374600301430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-member-reference.xml.txt000066400000000000000000000025411514765374600307520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-implicit-members.xml.txt000066400000000000000000000035711514765374600272050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-incomplete-twice.xml.txt000066400000000000000000000004601514765374600272050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-incomplete.xml.txt000066400000000000000000000003601514765374600260730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-member-Struct-anonymous.xml.txt000066400000000000000000000065321514765374600305220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-member-Union-anonymous.xml.txt000066400000000000000000000065271514765374600303320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-member-injected.xml.txt000066400000000000000000000070001514765374600267640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-member-template-access.xml.txt000066400000000000000000000067401514765374600302630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-member-template.xml.txt000066400000000000000000000036771514765374600270320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-ms-dllexport.xml.txt000066400000000000000000000033271514765374600263740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-ms-dllimport.xml.txt000066400000000000000000000033271514765374600263650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-partial-template-member-Typedef.xml.txt000066400000000000000000000041211514765374600320430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-Method-Argument-const.xml.txt000066400000000000000000000042131514765374600316720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-Method-Argument-default.xml.txt000066400000000000000000000037251514765374600321770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-Method-return-const.xml.txt000066400000000000000000000036651514765374600314410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-constructor-template.xml.txt000066400000000000000000000041401514765374600317430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*>( | ) $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-friends.xml.txt000066400000000000000000000041541514765374600272040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-member-Typedef-const.xml.txt000066400000000000000000000041641514765374600315440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-member-Typedef.xml.txt000066400000000000000000000040551514765374600304170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-member-nontemplate-Typedef.xml.txt000066400000000000000000000013531514765374600327410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-member-template.xml.txt000066400000000000000000000040211514765374600306230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template-recurse.xml.txt000066400000000000000000000034001514765374600272130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class-template.xml.txt000066400000000000000000000065271514765374600255620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Class.xml.txt000066400000000000000000000032051514765374600237370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Class.xml.txt000066400000000000000000000006051514765374600253400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Enumeration.xml.txt000066400000000000000000000007721514765374600265660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Field.xml.txt000066400000000000000000000040341514765374600253160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Function-expansion.xml.txt000066400000000000000000000011721514765374600300620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Function-separated.xml.txt000066400000000000000000000011711514765374600300250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Function.xml.txt000066400000000000000000000011561514765374600260620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Method.xml.txt000066400000000000000000000040751514765374600255200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Namespace.xml.txt000066400000000000000000000005331514765374600261670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-TypeAlias.xml.txt000066400000000000000000000010111514765374600261560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Typedef.xml.txt000066400000000000000000000007111514765374600256710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Comment-Variable.xml.txt000066400000000000000000000007131514765374600260200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Constructor-annotate.xml.txt000066400000000000000000000032751514765374600270350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Constructor-deprecated.xml.txt000066400000000000000000000032721514765374600273210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Constructor-ms-dllexport.xml.txt000066400000000000000000000032261514765374600276520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Constructor-ms-dllimport.xml.txt000066400000000000000000000032261514765374600276430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Constructor.xml.txt000066400000000000000000000031621514765374600252210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Converter-annotate.xml.txt000066400000000000000000000036261514765374600264570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Converter-deprecated.xml.txt000066400000000000000000000036211514765374600267410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Converter-ms-dllexport.xml.txt000066400000000000000000000035571514765374600273030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Converter-ms-dllimport.xml.txt000066400000000000000000000035571514765374600272740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Converter.xml.txt000066400000000000000000000035131514765374600246430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.CvQualifiedType.xml.txt000066400000000000000000000005441514765374600257330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Destructor-annotate.xml.txt000066400000000000000000000022571514765374600266450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Destructor-deprecated.xml.txt000066400000000000000000000022531514765374600271300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Destructor-ms-dllexport.xml.txt000066400000000000000000000022101514765374600274530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Destructor-ms-dllimport.xml.txt000066400000000000000000000022101514765374600274440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Destructor.xml.txt000066400000000000000000000021441514765374600250310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Elaborated-ns.xml.txt000066400000000000000000000012321514765374600253500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Elaborated.xml.txt000066400000000000000000000214231514765374600247360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration-annotate-multi.xml.txt000066400000000000000000000011261514765374600301170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration-annotate.xml.txt000066400000000000000000000010341514765374600267650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration-anonymous.xml.txt000066400000000000000000000007671514765374600272200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration-deprecated.xml.txt000066400000000000000000000010321514765374600272520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration-scoped.xml.txt000066400000000000000000000006271514765374600264400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration-type.xml.txt000066400000000000000000000006331514765374600261410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Enumeration.xml.txt000066400000000000000000000006641514765374600251660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Field-annotate.xml.txt000066400000000000000000000036231514765374600255300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Field-deprecated.xml.txt000066400000000000000000000036121514765374600260150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Field-init.xml.txt000066400000000000000000000042661514765374600246660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Field.xml.txt000066400000000000000000000031031514765374600237120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-Argument-Annotate.xml.txt000066400000000000000000000010421514765374600300030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-Argument-decay.xml.txt000066400000000000000000000023021514765374600273170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-Argument-default-cast.xml.txt000066400000000000000000000071631514765374600306200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-Argument-default-ns.xml.txt000066400000000000000000000024651514765374600303060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-Argument-default.xml.txt000066400000000000000000000013751514765374600276670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-Argument-deprecated.xml.txt000066400000000000000000000010451514765374600303350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-annotate.xml.txt000066400000000000000000000010311514765374600262610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-auto-undeduced.xml.txt000066400000000000000000000004361514765374600273660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-auto.xml.txt000066400000000000000000000005031514765374600254230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-calling-convention-ms-annotate.xml.txt000066400000000000000000000033671514765374600325030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-calling-convention-ms-deprecated.xml.txt000066400000000000000000000033631514765374600327660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-calling-convention-ms-dllexport.xml.txt000066400000000000000000000031141514765374600326750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-calling-convention-ms-dllimport.xml.txt000066400000000000000000000031141514765374600326660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-calling-convention-ms.xml.txt000066400000000000000000000030151514765374600306620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-deprecated.xml.txt000066400000000000000000000010231514765374600265510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-extern-C.xml.txt000066400000000000000000000007071514765374600261460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-lambda.xml.txt000066400000000000000000000012011514765374600256670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-ms-dllexport.xml.txt000066400000000000000000000007621514765374600271140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-ms-dllimport.xml.txt000066400000000000000000000007621514765374600271050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-rvalue-reference.xml.txt000066400000000000000000000016221514765374600277100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-template.xml.txt000066400000000000000000000012211514765374600262640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-throw.xml.txt000066400000000000000000000010501514765374600256140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function-variadic.xml.txt000066400000000000000000000007471514765374600262470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Function.xml.txt000066400000000000000000000007161514765374600244630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.FunctionType-variadic.xml.txt000066400000000000000000000007371514765374600271100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.FunctionType.xml.txt000066400000000000000000000007061514765374600253240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.FundamentalType-nullptr.xml.txt000066400000000000000000000007631514765374600274760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.FundamentalType.xml.txt000066400000000000000000000004611514765374600257730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.FundamentalTypes.xml.txt000066400000000000000000000046461514765374600261670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-_Float128.xml.txt000066400000000000000000000006101514765374600247550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-_Float32.xml.txt000066400000000000000000000006041514765374600246720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-_Float32x.xml.txt000066400000000000000000000006061514765374600250640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-_Float64.xml.txt000066400000000000000000000006041514765374600246770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-_Float64x.xml.txt000066400000000000000000000006101514765374600250640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-__float128-nostart.xml.txt000066400000000000000000000003031514765374600266430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-__float128.xml.txt000066400000000000000000000015201514765374600251550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-__float80.xml.txt000066400000000000000000000006231514765374600250750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-attr-assume.xml.txt000066400000000000000000000005061514765374600255670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-attr-malloc-args.xml.txt000066400000000000000000000006611514765374600264750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.GNU-va_arg_pack.xml.txt000066400000000000000000000006631514765374600255630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-Argument-default-cast.xml.txt000066400000000000000000000050501514765374600302440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-Argument-default.xml.txt000066400000000000000000000042111514765374600273120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-annotate.xml.txt000066400000000000000000000037471514765374600257340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-deprecated.xml.txt000066400000000000000000000037371514765374600262220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-final.xml.txt000066400000000000000000000074261514765374600252120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-ms-dllexport.xml.txt000066400000000000000000000037001514765374600265420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-ms-dllimport.xml.txt000066400000000000000000000037001514765374600265330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-override.xml.txt000066400000000000000000000074341514765374600257370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-overrides.xml.txt000066400000000000000000000074071514765374600261220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method-rvalue-reference.xml.txt000066400000000000000000000041641514765374600273470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Method.xml.txt000066400000000000000000000036341514765374600241200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.MethodType-cv.xml.txt000066400000000000000000000011421514765374600253600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.MethodType.xml.txt000066400000000000000000000010061514765374600247510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-Class-members.xml.txt000066400000000000000000000036301514765374600272630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-Class-partial-template-members.xml.txt000066400000000000000000000002061514765374600325220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-Class-template-members.xml.txt000066400000000000000000000002061514765374600310700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-Function-template-members.xml.txt000066400000000000000000000002061514765374600316100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-anonymous.xml.txt000066400000000000000000000005371514765374600266210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-empty.xml.txt000066400000000000000000000002061514765374600257200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-extern-C-members.xml.txt000066400000000000000000000010501514765374600276750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-inline-start.xml.txt000066400000000000000000000000641514765374600271750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-inline-template.xml.txt000066400000000000000000000010001514765374600276420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-inline.xml.txt000066400000000000000000000006121514765374600260410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-nested-1.xml.txt000066400000000000000000000011321514765374600262010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-nested-2.xml.txt000066400000000000000000000011321514765374600262020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-nested.xml.txt000066400000000000000000000014261514765374600260510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-repeat-start.xml.txt000066400000000000000000000007701514765374600272030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace-repeat.xml.txt000066400000000000000000000010551514765374600260450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Namespace.xml.txt000066400000000000000000000002061514765374600245640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OffsetType-cv.xml.txt000066400000000000000000000010761514765374600253740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OffsetType.xml.txt000066400000000000000000000006671514765374600247730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorFunction-annotate.xml.txt000066400000000000000000000014061514765374600300030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorFunction-deprecated.xml.txt000066400000000000000000000014101514765374600302650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorFunction-ms-dllexport.xml.txt000066400000000000000000000013371514765374600306270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorFunction-ms-dllimport.xml.txt000066400000000000000000000013371514765374600306200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorFunction.xml.txt000066400000000000000000000012731514765374600261760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorMethod-annotate.xml.txt000066400000000000000000000040011514765374600274300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorMethod-deprecated.xml.txt000066400000000000000000000040011514765374600277170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorMethod-ms-dllexport.xml.txt000066400000000000000000000037321514765374600302630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorMethod-ms-dllimport.xml.txt000066400000000000000000000037321514765374600302540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.OperatorMethod.xml.txt000066400000000000000000000036661514765374600256410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.PointerType.xml.txt000066400000000000000000000005551514765374600251610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.RValueReferenceType.xml.txt000066400000000000000000000006721514765374600265560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.ReferenceType.xml.txt000066400000000000000000000005611514765374600254340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.TypeAlias.xml.txt000066400000000000000000000005501514765374600245650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.TypeAliasTemplate.xml.txt000066400000000000000000000002061514765374600262570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-annotate.xml.txt000066400000000000000000000005641514765374600261060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-deprecated.xml.txt000066400000000000000000000005551514765374600263750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-paren.xml.txt000066400000000000000000000004571514765374600254030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-Class-template.xml.txt000066400000000000000000000005341514765374600275700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt000066400000000000000000000010001514765374600312130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-Enumeration.xml.txt000066400000000000000000000006751514765374600272060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-FundamentalType-mode.xml.txt000066400000000000000000000005071514765374600307340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-Struct-anonymous.xml.txt000066400000000000000000000034331514765374600302250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-Union-anonymous.xml.txt000066400000000000000000000034301514765374600300260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Typedef-to-extern-C-FundamentalType-mode.xml.txt000066400000000000000000000005201514765374600324120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-annotate.xml.txt000066400000000000000000000005661514765374600262350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-deprecated.xml.txt000066400000000000000000000005601514765374600265160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-extern-C.xml.txt000066400000000000000000000006051514765374600261030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-in-Class.xml.txt000066400000000000000000000035561514765374600260770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-init-cast.xml.txt000066400000000000000000000012141514765374600263060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-init-ns.xml.txt000066400000000000000000000011101514765374600257670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-init.xml.txt000066400000000000000000000013151514765374600253600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-lambda.xml.txt000066400000000000000000000005451514765374600256410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-ms-dllexport.xml.txt000066400000000000000000000005171514765374600270520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable-ms-dllimport.xml.txt000066400000000000000000000005321514765374600270400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.Variable.xml.txt000066400000000000000000000004531514765374600244210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.implicit-decl-ms.xml.txt000066400000000000000000000010371514765374600260270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.inline-asm-ms.xml.txt000066400000000000000000000005041514765374600253420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.invalid-decl-for-type.xml.txt000066400000000000000000000070401514765374600267710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.nostart.xml.txt000066400000000000000000000010221514765374600243570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* .* $ CastXML-CastXML-892090e/test/expect/castxml1.any.qualified-type-name.xml.txt000066400000000000000000000007651514765374600265420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.using-declaration-class.xml.txt000066400000000000000000000074501514765374600274130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.using-declaration-ns.xml.txt000066400000000000000000000010311514765374600267130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> ( | ) $ CastXML-CastXML-892090e/test/expect/castxml1.any.using-declaration-start.xml.txt000066400000000000000000000004441514765374600274370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.using-directive-ns.xml.txt000066400000000000000000000002061514765374600264070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.any.using-directive-start.xml.txt000066400000000000000000000004421514765374600271260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.broken.any.ReferenceType-to-Class-template.xml.txt000066400000000000000000000030351514765374600322060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> (broken: duplicate ReferenceType)? (broken: duplicate ReferenceType)? $ CastXML-CastXML-892090e/test/expect/castxml1.c++11.Class-bases.xml.txt000066400000000000000000000150771514765374600247670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++11.Class-template-bases.xml.txt000066400000000000000000000117671514765374600266020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++14.Class-bases.xml.txt000066400000000000000000000150771514765374600247720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++14.Class-template-bases.xml.txt000066400000000000000000000117671514765374600266050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++17.Class-bases.xml.txt000066400000000000000000000150771514765374600247750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++17.Class-template-bases.xml.txt000066400000000000000000000117671514765374600266100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++20.Class-bases.xml.txt000066400000000000000000000150771514765374600247670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++20.Class-template-bases.xml.txt000066400000000000000000000117671514765374600266020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++23.Class-bases.xml.txt000066400000000000000000000150771514765374600247720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++23.Class-template-bases.xml.txt000066400000000000000000000117671514765374600266050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.CXXLiteral.result.txt000066400000000000000000000000021514765374600253210ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/castxml1.c++98.CXXLiteral.stderr.txt000066400000000000000000000000271514765374600253150ustar00rootroot00000000000000error: expected a type CastXML-CastXML-892090e/test/expect/castxml1.c++98.CXXLiteral.xml.txt000066400000000000000000000000141514765374600246060ustar00rootroot00000000000000\(missing\) CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-annotate.xml.txt000066400000000000000000000023471514765374600255160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-base-offset.xml.txt000066400000000000000000000117051514765374600261010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-base-typedef.xml.txt000066400000000000000000000044321514765374600262520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-bases.xml.txt000066400000000000000000000111351514765374600247750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-deprecated-long.xml.txt000066400000000000000000000026021514765374600267340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-deprecated.xml.txt000066400000000000000000000023361514765374600260030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-friends.xml.txt000066400000000000000000000030171514765374600253320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-implicit-member-array.xml.txt000066400000000000000000000026441514765374600301000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-implicit-member-bad-base.xml.txt000066400000000000000000000043421514765374600304150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> ( | ) $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-implicit-member-const-aggregate.xml.txt000066400000000000000000000017461514765374600320360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-implicit-member-const.xml.txt000066400000000000000000000021051514765374600301000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-implicit-member-reference.xml.txt000066400000000000000000000021271514765374600307140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-implicit-members.xml.txt000066400000000000000000000026141514765374600271440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-member-Struct-anonymous.xml.txt000066400000000000000000000046111514765374600304600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-member-Union-anonymous.xml.txt000066400000000000000000000046061514765374600302700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-member-template-access.xml.txt000066400000000000000000000050011514765374600302120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-member-template.xml.txt000066400000000000000000000027221514765374600267620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-ms-dllexport.xml.txt000066400000000000000000000023271514765374600263350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-ms-dllimport.xml.txt000066400000000000000000000023271514765374600263260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-partial-template-member-Typedef.xml.txt000066400000000000000000000031351514765374600320110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-Method-Argument-const.xml.txt000066400000000000000000000032401514765374600316330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-Method-Argument-default.xml.txt000066400000000000000000000027501514765374600321360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-Method-return-const.xml.txt000066400000000000000000000027071514765374600313770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-bases.xml.txt000066400000000000000000000070131514765374600266060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-friends.xml.txt000066400000000000000000000031701514765374600271430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-member-Typedef-const.xml.txt000066400000000000000000000032061514765374600315020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-member-Typedef.xml.txt000066400000000000000000000031011514765374600303500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-member-template.xml.txt000066400000000000000000000030461514765374600305730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template-recurse.xml.txt000066400000000000000000000024071514765374600271630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class-template.xml.txt000066400000000000000000000045611514765374600255200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Class.xml.txt000066400000000000000000000022341514765374600237020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Comment-Method.xml.txt000066400000000000000000000031201514765374600254500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Constructor-annotate.xml.txt000066400000000000000000000023131514765374600267670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Constructor-deprecated.xml.txt000066400000000000000000000023101514765374600272530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Constructor-ms-dllexport.xml.txt000066400000000000000000000022441514765374600276130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Constructor-ms-dllimport.xml.txt000066400000000000000000000022441514765374600276040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Constructor.xml.txt000066400000000000000000000022001514765374600251530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Converter-annotate.xml.txt000066400000000000000000000026521514765374600264170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Converter-deprecated.xml.txt000066400000000000000000000026451514765374600267100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Converter-ms-dllexport.xml.txt000066400000000000000000000026031514765374600272340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Converter-ms-dllimport.xml.txt000066400000000000000000000026031514765374600272250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Converter.xml.txt000066400000000000000000000025371514765374600246120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Elaborated.xml.txt000066400000000000000000000174511514765374600247060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Field-annotate.xml.txt000066400000000000000000000026471514765374600254770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Field-deprecated.xml.txt000066400000000000000000000026361514765374600257640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Function-rvalue-reference.stderr.txt000066400000000000000000000000631514765374600303530ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-Argument-default-cast.xml.txt000066400000000000000000000040751514765374600302140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-Argument-default.xml.txt000066400000000000000000000032321514765374600272560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-annotate.xml.txt000066400000000000000000000027721514765374600256730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-deprecated.xml.txt000066400000000000000000000027621514765374600261610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-ms-dllexport.xml.txt000066400000000000000000000027231514765374600265100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-ms-dllimport.xml.txt000066400000000000000000000027231514765374600265010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-overrides.xml.txt000066400000000000000000000054421514765374600260610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method-rvalue-reference.stderr.txt000066400000000000000000000000631514765374600300060ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/castxml1.c++98.Method.xml.txt000066400000000000000000000026571514765374600240660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Namespace-Class-members.xml.txt000066400000000000000000000026611514765374600272300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.OperatorMethod-annotate.xml.txt000066400000000000000000000030251514765374600273770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.OperatorMethod-deprecated.xml.txt000066400000000000000000000030251514765374600276660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.OperatorMethod-ms-dllexport.xml.txt000066400000000000000000000027561514765374600302320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.OperatorMethod-ms-dllimport.xml.txt000066400000000000000000000027561514765374600302230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.OperatorMethod.xml.txt000066400000000000000000000027121514765374600255720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.RValueReferenceType.stderr.txt000066400000000000000000000000631514765374600272150ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/castxml1.c++98.TypeAlias.stderr.txt000066400000000000000000000000641514765374600252320ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/castxml1.c++98.TypeAliasTemplate.stderr.txt000066400000000000000000000000641514765374600267260ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/castxml1.c++98.Typedef-to-Struct-anonymous.xml.txt000066400000000000000000000024641514765374600301720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Typedef-to-Union-anonymous.xml.txt000066400000000000000000000024611514765374600277730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.Variable-in-Class.xml.txt000066400000000000000000000026021514765374600260300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.invalid-decl-for-type.xml.txt000066400000000000000000000050511514765374600267330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c++98.using-declaration-class.xml.txt000066400000000000000000000055061514765374600273550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Atomic-int-const.xml.txt000066400000000000000000000006421514765374600254570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Atomic-int.xml.txt000066400000000000000000000005511514765374600243320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Atomic-ptr.xml.txt000066400000000000000000000006511514765374600243460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Atomic-struct.xml.txt000066400000000000000000000007071514765374600250670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Elaborated.xml.txt000066400000000000000000000005721514765374600243730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Function.xml.txt000066400000000000000000000006741514765374600241210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.FunctionNoProto.xml.txt000066400000000000000000000004631514765374600254360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.FundamentalType.xml.txt000066400000000000000000000004571514765374600254330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-_Float128.xml.txt000066400000000000000000000005731514765374600244200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-_Float32.xml.txt000066400000000000000000000005671514765374600243350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-_Float32x.xml.txt000066400000000000000000000005711514765374600245200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-_Float64.xml.txt000066400000000000000000000005671514765374600243420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-_Float64x.xml.txt000066400000000000000000000005731514765374600245270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-__float128-nostart.xml.txt000066400000000000000000000003011514765374600262740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-__float128.xml.txt000066400000000000000000000005751514765374600246210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-__float80.xml.txt000066400000000000000000000006011514765374600245240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-attr-assume.xml.txt000066400000000000000000000004641514765374600252250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-attr-malloc-args.xml.txt000066400000000000000000000010621514765374600261240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.GNU-va_arg_pack.xml.txt000066400000000000000000000006411514765374600252120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Typedef-called-class.xml.txt000066400000000000000000000006201514765374600262500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.Variable.xml.txt000066400000000000000000000004511514765374600240520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/castxml1.c.invalid.result.txt000066400000000000000000000000021514765374600244610ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/castxml1.c.invalid.stderr.txt000066400000000000000000000001101514765374600244460ustar00rootroot00000000000000error: (unknown type name 'class'|use of undeclared identifier 'class') CastXML-CastXML-892090e/test/expect/cmd.castxml-and-objc1.result.txt000066400000000000000000000000021514765374600250300ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.castxml-and-objc1.stderr.txt000066400000000000000000000000771514765374600250310ustar00rootroot00000000000000^error: '--castxml-output=' does not work with Objective C$ CastXML-CastXML-892090e/test/expect/cmd.castxml-and-objc2.result.txt000066400000000000000000000000021514765374600250310ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.castxml-and-objc2.stderr.txt000066400000000000000000000000771514765374600250320ustar00rootroot00000000000000^error: '--castxml-output=' does not work with Objective C$ CastXML-CastXML-892090e/test/expect/cmd.castxml-empty-c++98-E.stdout.txt000066400000000000000000000000361514765374600253540ustar00rootroot00000000000000^#[^ ]*/test/input/empty.cxx" CastXML-CastXML-892090e/test/expect/cmd.castxml-empty-c++98-c.stderr.txt000066400000000000000000000001321514765374600253700ustar00rootroot00000000000000^(warning: argument unused during compilation: '-c' \[-Wunused-command-line-argument\])?$ CastXML-CastXML-892090e/test/expect/cmd.castxml-mix1.result.txt000066400000000000000000000000021514765374600241500ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.castxml-mix1.stderr.txt000066400000000000000000000001531514765374600241440ustar00rootroot00000000000000^error: '--castxml-gccxml' and '--castxml-output=' may not be not be used together! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.castxml-mix2.result.txt000066400000000000000000000000021514765374600241510ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.castxml-mix2.stderr.txt000066400000000000000000000001531514765374600241450ustar00rootroot00000000000000^error: '--castxml-gccxml' and '--castxml-output=' may not be not be used together! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.castxml-twice.result.txt000066400000000000000000000000021514765374600244050ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.castxml-twice.stderr.txt000066400000000000000000000001161514765374600244000ustar00rootroot00000000000000^error: '--castxml-output=' may be given at most once! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.castxml-wrong-epic-version.result.txt000066400000000000000000000000021514765374600270270ustar00rootroot000000000000000 CastXML-CastXML-892090e/test/expect/cmd.castxml-wrong-epic-version.stderr.txt000066400000000000000000000001161514765374600270220ustar00rootroot00000000000000^error: '--castxml-output=' accepts only '1' as ''! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-bad-cmd.result.txt000066400000000000000000000000021514765374600242620ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-bad-cmd.stderr.txt000066400000000000000000000001641514765374600242600ustar00rootroot00000000000000^error: '--castxml-cc-gnu' compiler command failed: 'cc-gnu-bad-cmd' '-E' '-dM' '-v' '.*/share/castxml/empty.cpp' CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-bad-cmd.result.txt000066400000000000000000000000021514765374600245020ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-bad-cmd.stderr.txt000066400000000000000000000001661514765374600245020ustar00rootroot00000000000000^error: '--castxml-cc-gnu-c' compiler command failed: 'cc-gnu-c-bad-cmd' '-E' '-dM' '-v' '.*/share/castxml/empty.c' CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-src-c-E.stdout.txt000066400000000000000000000010561514765374600244220ustar00rootroot00000000000000^(#define _WIN32 1 )?(#define __GCC_HAVE_DWARF2_CFI_ASM 1 )?#define __GNUC_MINOR__ 1 #define __GNUC__ 1( #define __MINGW32__ 1)? #define __assume__\(\.\.\.\)[ ]* #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 __malloc__\(\.\.\.\) __malloc__)?$ CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-src-c-cmd.stderr.txt000066400000000000000000000002421514765374600247560ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "[^"]*/include" "-iframework" "/some/Frameworks" "-iframework" "/some/CustomFW" "-[^i] CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-std-c11.stderr.txt000066400000000000000000000000261514765374600243620ustar00rootroot00000000000000"clang" .* "-std=c11" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-std-c89.stderr.txt000066400000000000000000000000261514765374600244010ustar00rootroot00000000000000"clang" .* "-std=c89" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-std-c99.stderr.txt000066400000000000000000000000261514765374600244020ustar00rootroot00000000000000"clang" .* "-std=c99" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-std-gnu11.stderr.txt000066400000000000000000000000301514765374600247240ustar00rootroot00000000000000"clang" .* "-std=gnu11" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-std-gnu89.stderr.txt000066400000000000000000000000301514765374600247430ustar00rootroot00000000000000"clang" .* "-std=gnu89" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-std-gnu99.stderr.txt000066400000000000000000000000301514765374600247440ustar00rootroot00000000000000"clang" .* "-std=gnu99" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt000066400000000000000000000013061514765374600254760ustar00rootroot00000000000000^(#define _WIN32 1 )?(#define __GCC_HAVE_DWARF2_CFI_ASM 1 )?#define __GNUC_MINOR__ 1 #define __GNUC__ 1( #define __MINGW32__ 1)? #define __NO_MATH_INLINES 1 #define __OPTIMIZE__ 1 #define __assume__\(\.\.\.\)[ ]* #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 __float80 __castxml__float80)? #define __i386__ 1( #define __malloc__\(\.\.\.\) __malloc__)?$ CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-fsized-deallocation.stderr.txt000066400000000000000000000000421514765374600267040ustar00rootroot00000000000000"clang" .* "-fsized-deallocation" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-intrinsics-arm64v8.stderr.txt000066400000000000000000000000301514765374600263530ustar00rootroot00000000000000Target: aarch64-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-intrinsics-armv7.stderr.txt000066400000000000000000000000241514765374600262030ustar00rootroot00000000000000Target: arm-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-src-c-E.result.txt000066400000000000000000000000021514765374600241640ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-src-c-E.stderr.txt000066400000000000000000000001101514765374600241510ustar00rootroot00000000000000^error: invalid argument '-std=gnu\+\+98' not allowed with 'C(/ObjC)?'$ CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-src-cxx-E.stdout.txt000066400000000000000000000011121514765374600245530ustar00rootroot00000000000000^(#define _WIN32 1 )?(#define __GCC_HAVE_DWARF2_CFI_ASM 1 )?#define __GNUC_MINOR__ 1 #define __GNUC__ 1( #define __MINGW32__ 1)? #define __assume__\(\.\.\.\)[ ]* #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 __malloc__\(\.\.\.\) __malloc__)?$ CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-src-cxx-cmd.stderr.txt000066400000000000000000000002421514765374600251160ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "[^"]*/include" "-iframework" "/some/Frameworks" "-iframework" "/some/CustomFW" "-[^i] CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++11.stderr.txt000066400000000000000000000000321514765374600242650ustar00rootroot00000000000000"clang" .* "-std=c\+\+11" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++14.stderr.txt000066400000000000000000000000321514765374600242700ustar00rootroot00000000000000"clang" .* "-std=c\+\+14" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++17.stderr.txt000066400000000000000000000000321514765374600242730ustar00rootroot00000000000000"clang" .* "-std=c\+\+17" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++1z.stderr.txt000066400000000000000000000000321514765374600243760ustar00rootroot00000000000000"clang" .* "-std=c\+\+1z" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++20.stderr.txt000066400000000000000000000000321514765374600242650ustar00rootroot00000000000000"clang" .* "-std=c\+\+20" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++23.stderr.txt000066400000000000000000000000321514765374600242700ustar00rootroot00000000000000"clang" .* "-std=c\+\+23" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-c++98.stderr.txt000066400000000000000000000000321514765374600243040ustar00rootroot00000000000000"clang" .* "-std=c\+\+98" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-explicit.stderr.txt000066400000000000000000000000321514765374600253740ustar00rootroot00000000000000"clang" .* "-std=c\+\+14" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++11.stderr.txt000066400000000000000000000000341514765374600246360ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+11" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++14.stderr.txt000066400000000000000000000000341514765374600246410ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+14" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++17.stderr.txt000066400000000000000000000000341514765374600246440ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+17" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++1z.stderr.txt000066400000000000000000000000341514765374600247470ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+1z" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++20.stderr.txt000066400000000000000000000000341514765374600246360ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+20" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++23.stderr.txt000066400000000000000000000000341514765374600246410ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+23" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-std-gnu++98.stderr.txt000066400000000000000000000000341514765374600246550ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+98" CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-aarch64.stderr.txt000066400000000000000000000000301514765374600250050ustar00rootroot00000000000000Target: aarch64-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-amd64.stderr.txt000066400000000000000000000000261514765374600244750ustar00rootroot00000000000000Target: amd64-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-arm.stderr.txt000066400000000000000000000000241514765374600243370ustar00rootroot00000000000000Target: arm-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-explicit.stderr.txt000066400000000000000000000000411514765374600254000ustar00rootroot00000000000000Target: explicit-target-triple . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt000066400000000000000000000013421514765374600252560ustar00rootroot00000000000000^(#define _WIN32 1 )?(#define __GCC_HAVE_DWARF2_CFI_ASM 1 )?#define __GNUC_MINOR__ 1 #define __GNUC__ 1( #define __MINGW32__ 1)? #define __NO_MATH_INLINES 1 #define __OPTIMIZE__ 1 #define __assume__\(\.\.\.\)[ ]* #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 __float80 __castxml__float80)? #define __i386__ 1( #define __malloc__\(\.\.\.\) __malloc__)?$ CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-i386.stderr.txt000066400000000000000000000000251514765374600242520ustar00rootroot00000000000000Target: i386-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-mingw.stderr.txt000066400000000000000000000000371514765374600247050ustar00rootroot00000000000000Target: [^ ]+-pc-windows-gnu . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-win.stderr.txt000066400000000000000000000000401514765374600243530ustar00rootroot00000000000000Target: [^ ]+-pc-windows[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-gnu-tgt-x86_64.stderr.txt000066400000000000000000000000271514765374600245210ustar00rootroot00000000000000Target: x86_64-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-missing.result.txt000066400000000000000000000000021514765374600236550ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-missing.stderr.txt000066400000000000000000000001271514765374600236520ustar00rootroot00000000000000^error: '--castxml-cc-gnu' must be followed by a compiler command! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-bad-cmd.result.txt000066400000000000000000000000021514765374600244410ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-bad-cmd.stderr.txt000066400000000000000000000002131514765374600244320ustar00rootroot00000000000000^error: '--castxml-cc-msvc' compiler command failed: 'cc-msvc-bad-cmd' '-c' '[^']*/share/castxml/detect_vs.cpp' '-Fo[^']*/detect_vs.obj' CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-builtin-1800-E.stdout.txt000066400000000000000000000006001514765374600254000ustar00rootroot00000000000000^#define _MSC_VER 1800 #define _WIN32 1 (#define __GCC_HAVE_DWARF2_CFI_ASM 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-CastXML-892090e/test/expect/cmd.cc-msvc-builtin-1900-E.stdout.txt000066400000000000000000000010641514765374600254060ustar00rootroot00000000000000^#define _MSC_VER 1900 #define _WIN32 1 (#define __GCC_HAVE_DWARF2_CFI_ASM 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-CastXML-892090e/test/expect/cmd.cc-msvc-c-bad-cmd.result.txt000066400000000000000000000000021514765374600246610ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-c-bad-cmd.stderr.txt000066400000000000000000000002151514765374600246540ustar00rootroot00000000000000^error: '--castxml-cc-msvc-c' compiler command failed: 'cc-msvc-c-bad-cmd' '-c' '[^']*/share/castxml/detect_vs.c' '-Fo[^']*/detect_vs.obj' CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-c-src-c-E.stdout.txt000066400000000000000000000004751514765374600246050ustar00rootroot00000000000000^#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-CastXML-892090e/test/expect/cmd.cc-msvc-c-src-c-cmd.stderr.txt000066400000000000000000000001601514765374600251340ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "/some/other/include" "-([^i]|i[^s]) CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-c-std-c89.stderr.txt000066400000000000000000000000261514765374600245600ustar00rootroot00000000000000"clang" .* "-std=c89" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-src-c-E.result.txt000066400000000000000000000000021514765374600243430ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-src-c-E.stderr.txt000066400000000000000000000001061514765374600243350ustar00rootroot00000000000000^error: invalid argument '-std=c\+\+11' not allowed with 'C(/ObjC)?'$ CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-src-cxx-E.stdout.txt000066400000000000000000000006001514765374600247330ustar00rootroot00000000000000^#define _MSC_VER 1600 #define _WIN32 1 (#define __GCC_HAVE_DWARF2_CFI_ASM 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-CastXML-892090e/test/expect/cmd.cc-msvc-src-cxx-cmd.stderr.txt000066400000000000000000000001601514765374600252740ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "/some/other/include" "-([^i]|i[^s]) CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++11.stderr.txt000066400000000000000000000000321514765374600244440ustar00rootroot00000000000000"clang" .* "-std=c\+\+11" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++14.stderr.txt000066400000000000000000000000321514765374600244470ustar00rootroot00000000000000"clang" .* "-std=c\+\+14" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++17-E.stdout.txt000066400000000000000000000011751514765374600246640ustar00rootroot00000000000000^#define _MSC_VER 1900 #define _MSVC_LANG 201703L #define _WIN32 1 (#define __GCC_HAVE_DWARF2_CFI_ASM 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-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++17.stderr.txt000066400000000000000000000000321514765374600244520ustar00rootroot00000000000000"clang" .* "-std=c\+\+17" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++20-E.stdout.txt000066400000000000000000000013001514765374600246440ustar00rootroot00000000000000^#define _MSC_VER 1930 #define _MSVC_LANG 202002L #define _WIN32 1 (#define __GCC_HAVE_DWARF2_CFI_ASM 1 )?#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16ll #define __builtin_assume_aligned __castxml__builtin_assume_aligned #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-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++20.stderr.txt000066400000000000000000000000321514765374600244440ustar00rootroot00000000000000"clang" .* "-std=c\+\+20" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++23-E.stdout.txt000066400000000000000000000013001514765374600246470ustar00rootroot00000000000000^#define _MSC_VER 1944 #define _MSVC_LANG 202302L #define _WIN32 1 (#define __GCC_HAVE_DWARF2_CFI_ASM 1 )?#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16ll #define __builtin_assume_aligned __castxml__builtin_assume_aligned #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-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++23.stderr.txt000066400000000000000000000000321514765374600244470ustar00rootroot00000000000000"clang" .* "-std=c\+\+23" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-c++98.stderr.txt000066400000000000000000000000321514765374600244630ustar00rootroot00000000000000"clang" .* "-std=c\+\+98" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-std-explicit.stderr.txt000066400000000000000000000000341514765374600255550ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+14" CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-aarch64.stderr.txt000066400000000000000000000000421514765374600251670ustar00rootroot00000000000000Target: aarch64-[^ ]+-msvc[^ ]* . CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-amd64.stderr.txt000066400000000000000000000000401514765374600246500ustar00rootroot00000000000000Target: amd64-[^ ]+-msvc[^ ]* . CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-arm.stderr.txt000066400000000000000000000000241514765374600245160ustar00rootroot00000000000000Target: arm-[^ ]+ . CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-explicit.stderr.txt000066400000000000000000000000411514765374600255570ustar00rootroot00000000000000Target: explicit-target-triple . CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-i386.stderr.txt000066400000000000000000000000371514765374600244340ustar00rootroot00000000000000Target: i386-[^ ]+-msvc[^ ]* . CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-win.stderr.txt000066400000000000000000000000461514765374600245400ustar00rootroot00000000000000Target: [^ -]+-pc-windows-msvc[^ ]* . CastXML-CastXML-892090e/test/expect/cmd.cc-msvc-tgt-x86_64.stderr.txt000066400000000000000000000000411514765374600246740ustar00rootroot00000000000000Target: x86_64-[^ ]+-msvc[^ ]* . CastXML-CastXML-892090e/test/expect/cmd.cc-option.result.txt000066400000000000000000000000021514765374600235140ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-option.stderr.txt000066400000000000000000000001221514765374600235040ustar00rootroot00000000000000^error: argument to '--castxml-cc-gnu' may not start with '-' Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-paren-castxml.result.txt000066400000000000000000000000021514765374600247620ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-paren-castxml.stderr.txt000066400000000000000000000001341514765374600247550ustar00rootroot00000000000000^error: arguments to '--castxml-cc-gnu' may not start with '--castxml-' Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-paren-nested.result.txt000066400000000000000000000000021514765374600245710ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-paren-nested.stderr.txt000066400000000000000000000001041514765374600245610ustar00rootroot00000000000000^error: '--castxml-cc-gnu' compiler command failed: '\(' '\)' .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-paren-unbalanced.result.txt000066400000000000000000000000021514765374600254030ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-paren-unbalanced.stderr.txt000066400000000000000000000001141514765374600253740ustar00rootroot00000000000000^error: unbalanced parentheses after '--castxml-cc-gnu' Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-twice.result.txt000066400000000000000000000000021514765374600233170ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-twice.stderr.txt000066400000000000000000000001131514765374600233070ustar00rootroot00000000000000^error: '--castxml-cc-' may be given at most once! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.cc-unknown.result.txt000066400000000000000000000000021514765374600237030ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.cc-unknown.stderr.txt000066400000000000000000000000531514765374600236760ustar00rootroot00000000000000^error: '--castxml-cc-unknown' not known!$ CastXML-CastXML-892090e/test/expect/cmd.fbracket-depth.result.txt000066400000000000000000000000021514765374600245040ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.fbracket-depth.stderr.txt000066400000000000000000000001461514765374600245020ustar00rootroot00000000000000[^ ]*/test/input/fbracket-depth.c:[0-9:]+: fatal error: bracket nesting level exceeded maximum of 300 CastXML-CastXML-892090e/test/expect/cmd.gccxml-and-objc1.result.txt000066400000000000000000000000021514765374600246320ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.gccxml-and-objc1.stderr.txt000066400000000000000000000000731514765374600246270ustar00rootroot00000000000000^error: '--castxml-gccxml' does not work with Objective C$ CastXML-CastXML-892090e/test/expect/cmd.gccxml-and-objc2.result.txt000066400000000000000000000000021514765374600246330ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.gccxml-and-objc2.stderr.txt000066400000000000000000000000731514765374600246300ustar00rootroot00000000000000^error: '--castxml-gccxml' does not work with Objective C$ CastXML-CastXML-892090e/test/expect/cmd.gccxml-empty-c++98-E.stdout.txt000066400000000000000000000000361514765374600251560ustar00rootroot00000000000000^#[^ ]*/test/input/empty.cxx" CastXML-CastXML-892090e/test/expect/cmd.gccxml-empty-c++98-c.stderr.txt000066400000000000000000000001321514765374600251720ustar00rootroot00000000000000^(warning: argument unused during compilation: '-c' \[-Wunused-command-line-argument\])?$ CastXML-CastXML-892090e/test/expect/cmd.gccxml-twice.result.txt000066400000000000000000000000021514765374600242070ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.gccxml-twice.stderr.txt000066400000000000000000000001121514765374600241760ustar00rootroot00000000000000^error: '--castxml-gccxml' may be given at most once! Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.help1.stdout.txt000066400000000000000000000002501514765374600226430ustar00rootroot00000000000000^Usage: castxml .* Help for the internal Clang compiler appears below. --------------------------------------------------------------- OVERVIEW: clang LLVM compiler CastXML-CastXML-892090e/test/expect/cmd.help2.stdout.txt000066400000000000000000000002501514765374600226440ustar00rootroot00000000000000^Usage: castxml .* Help for the internal Clang compiler appears below. --------------------------------------------------------------- OVERVIEW: clang LLVM compiler CastXML-CastXML-892090e/test/expect/cmd.input-missing.result.txt000066400000000000000000000000021514765374600244270ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.input-missing.stderr.txt000066400000000000000000000001331514765374600244210ustar00rootroot00000000000000^error: no such file or directory: '.*/test/input/does-not-exist.c' error: no input files$ CastXML-CastXML-892090e/test/expect/cmd.o-missing.result.txt000066400000000000000000000000021514765374600235260ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.o-missing.stderr.txt000066400000000000000000000001151514765374600235200ustar00rootroot00000000000000^error: argument to '-o' is missing \(expected 1 value\) Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.predefined-macros.stdout.txt.in000066400000000000000000000012361514765374600256330ustar00rootroot00000000000000#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 __c[^ ]*)* #define __clang__ 1( #define __clang_literal_encoding__ [^ ]*)? #define __clang_major__ [0-9]+ #define __clang_minor__ [0-9]+ #define __clang_patchlevel__ [0-9]+ #define __clang_version__ CastXML-CastXML-892090e/test/expect/cmd.rsp-missing.result.txt000066400000000000000000000000021514765374600240740ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.rsp-missing.stderr.txt000066400000000000000000000001361514765374600240710ustar00rootroot00000000000000^error: no such file or directory: '@.*/test/input/does-not-exist.rsp' error: no input files$ CastXML-CastXML-892090e/test/expect/cmd.rsp-o-missing.result.txt000066400000000000000000000000021514765374600243300ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.rsp-o-missing.stderr.txt000066400000000000000000000001151514765374600243220ustar00rootroot00000000000000^error: argument to '-o' is missing \(expected 1 value\) Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.start-missing.result.txt000066400000000000000000000000021514765374600244250ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.start-missing.stderr.txt000066400000000000000000000001321514765374600244160ustar00rootroot00000000000000^error: argument to '--castxml-start' is missing \(expected 1 value\) Usage: castxml .*$ CastXML-CastXML-892090e/test/expect/cmd.std-c++98-src-c.result.txt000066400000000000000000000000021514765374600241470ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.std-c++98-src-c.stderr.txt000066400000000000000000000001061514765374600241410ustar00rootroot00000000000000^error: invalid argument '-std=c\+\+98' not allowed with 'C(/ObjC)?'$ CastXML-CastXML-892090e/test/expect/cmd.std-c89-src-cxx.result.txt000066400000000000000000000000021514765374600244010ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/cmd.std-c89-src-cxx.stderr.txt000066400000000000000000000001121514765374600243700ustar00rootroot00000000000000^error: invalid argument '-std=c89' not allowed with 'C\+\+(/ObjC\+\+)?'$ CastXML-CastXML-892090e/test/expect/cmd.version.stdout.txt000066400000000000000000000002171514765374600233220ustar00rootroot00000000000000^castxml version [0-9]+\.[0-9]+[^\n]* CastXML project maintained and supported by Kitware \(kitware.com\). [^ ]*clang version [0-9]+\.[0-9]+ CastXML-CastXML-892090e/test/expect/gccxml.any.ArrayType-incomplete.xml.txt000066400000000000000000000005461514765374600264750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.ArrayType.xml.txt000066400000000000000000000005341514765374600243350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Atomic-int-const.xml.txt000066400000000000000000000005171514765374600255460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Atomic-int.xml.txt000066400000000000000000000004261514765374600244210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Atomic-ptr.xml.txt000066400000000000000000000004261514765374600244340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Atomic-struct.xml.txt000066400000000000000000000004311514765374600251470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.CXXLiteral.xml.txt000066400000000000000000000002061514765374600243700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-abstract.xml.txt000066400000000000000000000031311514765374600252570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-annotate.xml.txt000066400000000000000000000022501514765374600252660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-base-offset.xml.txt000066400000000000000000000007541514765374600256620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-base-typedef.xml.txt000066400000000000000000000043221514765374600260270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-deprecated-long.xml.txt000066400000000000000000000022401514765374600265110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-deprecated.xml.txt000066400000000000000000000022331514765374600255560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-forward.xml.txt000066400000000000000000000020301514765374600251150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-friends.xml.txt000066400000000000000000000026631514765374600251170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-access-mutable.xml.txt000066400000000000000000000033331514765374600314250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-access.xml.txt000066400000000000000000000030041514765374600277710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-array.xml.txt000066400000000000000000000026001514765374600276470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt000066400000000000000000000042651514765374600302000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> ( | ) $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-const-aggregate.xml.txt000066400000000000000000000017241514765374600316110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-const.xml.txt000066400000000000000000000020631514765374600276620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-member-reference.xml.txt000066400000000000000000000021051514765374600304670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-implicit-members.xml.txt000066400000000000000000000025501514765374600267220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-incomplete-twice.xml.txt000066400000000000000000000004601514765374600267260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-incomplete.xml.txt000066400000000000000000000003601514765374600256140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-member-Struct-anonymous.xml.txt000066400000000000000000000044101514765374600302340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-member-Union-anonymous.xml.txt000066400000000000000000000044061514765374600300450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-member-injected.xml.txt000066400000000000000000000046301514765374600265130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-member-template-access.xml.txt000066400000000000000000000046711514765374600300050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-member-template.xml.txt000066400000000000000000000026561514765374600265470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-ms-dllexport.xml.txt000066400000000000000000000024011514765374600261050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-ms-dllimport.xml.txt000066400000000000000000000024011514765374600260760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-partial-template-member-Typedef.xml.txt000066400000000000000000000030711514765374600315670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-Method-Argument-const.xml.txt000066400000000000000000000031741514765374600314200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-Method-Argument-default.xml.txt000066400000000000000000000027041514765374600317140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-Method-return-const.xml.txt000066400000000000000000000026431514765374600311550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-constructor-template.xml.txt000066400000000000000000000041401514765374600314640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*>( | ) $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-friends.xml.txt000066400000000000000000000030341514765374600267210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-member-Typedef-const.xml.txt000066400000000000000000000031421514765374600312600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-member-Typedef.xml.txt000066400000000000000000000030351514765374600301350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-member-nontemplate-Typedef.xml.txt000066400000000000000000000012471514765374600324640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-member-template.xml.txt000066400000000000000000000030021514765374600303420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template-recurse.xml.txt000066400000000000000000000023541514765374600267430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class-template.xml.txt000066400000000000000000000044511514765374600252750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Class.xml.txt000066400000000000000000000021701514765374600234600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Class.xml.txt000066400000000000000000000003551514765374600250630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Enumeration.xml.txt000066400000000000000000000004071514765374600263020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Field.xml.txt000066400000000000000000000031231514765374600250350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Function-expansion.xml.txt000066400000000000000000000007401514765374600276030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Function-separated.xml.txt000066400000000000000000000007401514765374600275470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Function.xml.txt000066400000000000000000000007261514765374600256050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Method.xml.txt000066400000000000000000000026231514765374600252360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Namespace.xml.txt000066400000000000000000000002061514765374600257050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-TypeAlias.xml.txt000066400000000000000000000005601514765374600257070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Typedef.xml.txt000066400000000000000000000004611514765374600254140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Comment-Variable.xml.txt000066400000000000000000000004631514765374600255430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Constructor-annotate.xml.txt000066400000000000000000000022251514765374600265500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Constructor-deprecated.xml.txt000066400000000000000000000022101514765374600270310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Constructor-ms-dllexport.xml.txt000066400000000000000000000022111514765374600273640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Constructor-ms-dllimport.xml.txt000066400000000000000000000022111514765374600273550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Constructor.xml.txt000066400000000000000000000021451514765374600247420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Converter-annotate.xml.txt000066400000000000000000000025531514765374600261760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Converter-deprecated.xml.txt000066400000000000000000000025361514765374600264660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Converter-ms-dllexport.xml.txt000066400000000000000000000025371514765374600270210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Converter-ms-dllimport.xml.txt000066400000000000000000000025371514765374600270120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Converter.xml.txt000066400000000000000000000024731514765374600243700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.CvQualifiedType.xml.txt000066400000000000000000000005441514765374600254540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Destructor-annotate.xml.txt000066400000000000000000000022241514765374600263600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Destructor-deprecated.xml.txt000066400000000000000000000022071514765374600266500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Destructor-ms-dllexport.xml.txt000066400000000000000000000022101514765374600271740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Destructor-ms-dllimport.xml.txt000066400000000000000000000022101514765374600271650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Destructor.xml.txt000066400000000000000000000021441514765374600245520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Elaborated-ns.xml.txt000066400000000000000000000011401514765374600250670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Elaborated.xml.txt000066400000000000000000000163231514765374600244620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration-annotate-multi.xml.txt000066400000000000000000000006571514765374600276500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration-annotate.xml.txt000066400000000000000000000006131514765374600265100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration-anonymous.xml.txt000066400000000000000000000006341514765374600267320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration-deprecated.xml.txt000066400000000000000000000005571514765374600270060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration-scoped.xml.txt000066400000000000000000000004751514765374600261620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration-type.xml.txt000066400000000000000000000004731514765374600256640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Enumeration.xml.txt000066400000000000000000000005311514765374600247000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Field-annotate.xml.txt000066400000000000000000000025501514765374600252470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Field-deprecated.xml.txt000066400000000000000000000025331514765374600255370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Field-init.xml.txt000066400000000000000000000032051514765374600243770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Field.xml.txt000066400000000000000000000031031514765374600234330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-Argument-Annotate.xml.txt000066400000000000000000000010071514765374600275250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-Argument-decay.xml.txt000066400000000000000000000023021514765374600270400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-Argument-default-cast.xml.txt000066400000000000000000000071631514765374600303410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-Argument-default-ns.xml.txt000066400000000000000000000024471514765374600300270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-Argument-default.xml.txt000066400000000000000000000013751514765374600274100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-Argument-deprecated.xml.txt000066400000000000000000000007721514765374600300640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-annotate.xml.txt000066400000000000000000000007761514765374600260210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-auto-undeduced.xml.txt000066400000000000000000000004651514765374600271110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-auto.xml.txt000066400000000000000000000005031514765374600251440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-calling-convention-ms-annotate.xml.txt000066400000000000000000000032131514765374600322120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-calling-convention-ms-deprecated.xml.txt000066400000000000000000000031211514765374600324770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-calling-convention-ms-dllexport.xml.txt000066400000000000000000000031141514765374600324160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-calling-convention-ms-dllimport.xml.txt000066400000000000000000000031141514765374600324070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-calling-convention-ms.xml.txt000066400000000000000000000030151514765374600304030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-deprecated.xml.txt000066400000000000000000000007611514765374600263020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-extern-C.xml.txt000066400000000000000000000007071514765374600256670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-lambda.xml.txt000066400000000000000000000012011514765374600254100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-ms-dllexport.xml.txt000066400000000000000000000007621514765374600266350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-ms-dllimport.xml.txt000066400000000000000000000007621514765374600266260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-rvalue-reference.xml.txt000066400000000000000000000006311514765374600274300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-template.xml.txt000066400000000000000000000012211514765374600260050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-throw.xml.txt000066400000000000000000000010501514765374600253350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function-variadic.xml.txt000066400000000000000000000007471514765374600257700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Function.xml.txt000066400000000000000000000007161514765374600242040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.FunctionType-variadic.xml.txt000066400000000000000000000007371514765374600266310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.FunctionType.xml.txt000066400000000000000000000007061514765374600250450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.FundamentalType-nullptr.xml.txt000066400000000000000000000010001514765374600272000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.FundamentalType.xml.txt000066400000000000000000000004611514765374600255140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.FundamentalTypes.xml.txt000066400000000000000000000046461514765374600257100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-_Float128.xml.txt000066400000000000000000000006101514765374600244760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-_Float32.xml.txt000066400000000000000000000006041514765374600244130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-_Float32x.xml.txt000066400000000000000000000006061514765374600246050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-_Float64.xml.txt000066400000000000000000000006041514765374600244200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-_Float64x.xml.txt000066400000000000000000000006101514765374600246050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-__float128-nostart.xml.txt000066400000000000000000000003031514765374600263640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-__float128.xml.txt000066400000000000000000000015201514765374600246760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-__float80.xml.txt000066400000000000000000000006231514765374600246160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-attr-assume.xml.txt000066400000000000000000000005061514765374600253100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-attr-malloc-args.xml.txt000066400000000000000000000006611514765374600262160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.GNU-va_arg_pack.xml.txt000066400000000000000000000006631514765374600253040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-Argument-default-cast.xml.txt000066400000000000000000000040311514765374600277630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-Argument-default.xml.txt000066400000000000000000000031661514765374600270430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-annotate.xml.txt000066400000000000000000000026731514765374600254520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-deprecated.xml.txt000066400000000000000000000026561514765374600257420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-final.xml.txt000066400000000000000000000053511514765374600247260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-ms-dllexport.xml.txt000066400000000000000000000026571514765374600262750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-ms-dllimport.xml.txt000066400000000000000000000026571514765374600262660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-override.xml.txt000066400000000000000000000053571514765374600254620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-overrides.xml.txt000066400000000000000000000053321514765374600256360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method-rvalue-reference.xml.txt000066400000000000000000000021601514765374600270620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Method.xml.txt000066400000000000000000000026131514765374600236350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.MethodType-cv.xml.txt000066400000000000000000000011421514765374600251010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.MethodType.xml.txt000066400000000000000000000010061514765374600244720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-Class-members.xml.txt000066400000000000000000000026151514765374600270060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-Class-partial-template-members.xml.txt000066400000000000000000000002061514765374600322430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-Class-template-members.xml.txt000066400000000000000000000002061514765374600306110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-Function-template-members.xml.txt000066400000000000000000000002061514765374600313310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-anonymous.xml.txt000066400000000000000000000005371514765374600263420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-empty.xml.txt000066400000000000000000000002061514765374600254410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-extern-C-members.xml.txt000066400000000000000000000010501514765374600274160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-inline-start.xml.txt000066400000000000000000000000641514765374600267160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-inline-template.xml.txt000066400000000000000000000010001514765374600273630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-inline.xml.txt000066400000000000000000000006121514765374600255620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-nested-1.xml.txt000066400000000000000000000011321514765374600257220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-nested-2.xml.txt000066400000000000000000000011321514765374600257230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-nested.xml.txt000066400000000000000000000014261514765374600255720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-repeat-start.xml.txt000066400000000000000000000007701514765374600267240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace-repeat.xml.txt000066400000000000000000000010551514765374600255660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Namespace.xml.txt000066400000000000000000000002061514765374600243050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OffsetType-cv.xml.txt000066400000000000000000000010761514765374600251150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OffsetType.xml.txt000066400000000000000000000006671514765374600245140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorFunction-annotate.xml.txt000066400000000000000000000013531514765374600275250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorFunction-deprecated.xml.txt000066400000000000000000000013361514765374600300150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorFunction-ms-dllexport.xml.txt000066400000000000000000000013371514765374600303500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorFunction-ms-dllimport.xml.txt000066400000000000000000000013371514765374600303410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorFunction.xml.txt000066400000000000000000000012731514765374600257170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorMethod-annotate.xml.txt000066400000000000000000000027261514765374600271650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorMethod-deprecated.xml.txt000066400000000000000000000027111514765374600274460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorMethod-ms-dllexport.xml.txt000066400000000000000000000027121514765374600300010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorMethod-ms-dllimport.xml.txt000066400000000000000000000027121514765374600277720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.OperatorMethod.xml.txt000066400000000000000000000026461514765374600253570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.PointerType.xml.txt000066400000000000000000000005551514765374600247020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.RValueReferenceType.xml.txt000066400000000000000000000002061514765374600262700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.ReferenceType.xml.txt000066400000000000000000000005611514765374600251550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.TypeAlias.xml.txt000066400000000000000000000005501514765374600243060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.TypeAliasTemplate.xml.txt000066400000000000000000000002061514765374600260000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-annotate.xml.txt000066400000000000000000000005311514765374600256210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-deprecated.xml.txt000066400000000000000000000005141514765374600261110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-paren.xml.txt000066400000000000000000000004571514765374600251240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-Class-template.xml.txt000066400000000000000000000005341514765374600273110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt000066400000000000000000000005601514765374600307460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-Enumeration.xml.txt000066400000000000000000000005421514765374600267200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-FundamentalType-mode.xml.txt000066400000000000000000000005071514765374600304550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-Struct-anonymous.xml.txt000066400000000000000000000023271514765374600277470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-Union-anonymous.xml.txt000066400000000000000000000023251514765374600275510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Typedef-to-extern-C-FundamentalType-mode.xml.txt000066400000000000000000000005201514765374600321330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-annotate.xml.txt000066400000000000000000000005331514765374600257500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-deprecated.xml.txt000066400000000000000000000005161514765374600262400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-extern-C.xml.txt000066400000000000000000000006051514765374600256240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-in-Class.xml.txt000066400000000000000000000025361514765374600256150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-init-cast.xml.txt000066400000000000000000000012141514765374600260270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-init-ns.xml.txt000066400000000000000000000011101514765374600255100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-init.xml.txt000066400000000000000000000013151514765374600251010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-lambda.xml.txt000066400000000000000000000005451514765374600253620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-ms-dllexport.xml.txt000066400000000000000000000005171514765374600265730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable-ms-dllimport.xml.txt000066400000000000000000000005321514765374600265610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.Variable.xml.txt000066400000000000000000000004531514765374600241420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.implicit-decl-ms.xml.txt000066400000000000000000000010371514765374600255500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.inline-asm-ms.xml.txt000066400000000000000000000005041514765374600250630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.invalid-decl-for-type.xml.txt000066400000000000000000000047631514765374600265230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.nostart.xml.txt000066400000000000000000000010221514765374600241000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* .* $ CastXML-CastXML-892090e/test/expect/gccxml.any.qualified-type-name.xml.txt000066400000000000000000000006761514765374600262640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.using-declaration-class.xml.txt000066400000000000000000000053761514765374600271410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.using-declaration-ns.xml.txt000066400000000000000000000006111514765374600264370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.using-declaration-start.xml.txt000066400000000000000000000004441514765374600271600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.using-directive-ns.xml.txt000066400000000000000000000002061514765374600261300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.any.using-directive-start.xml.txt000066400000000000000000000004421514765374600266470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.broken.any.ReferenceType-to-Class-template.xml.txt000066400000000000000000000030351514765374600317270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> (broken: duplicate ReferenceType)? (broken: duplicate ReferenceType)? $ CastXML-CastXML-892090e/test/expect/gccxml.c++11.Class-bases.xml.txt000066400000000000000000000107151514765374600245020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++11.Class-template-bases.xml.txt000066400000000000000000000066371514765374600263230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++14.Class-bases.xml.txt000066400000000000000000000107151514765374600245050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++14.Class-template-bases.xml.txt000066400000000000000000000066371514765374600263260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++17.Class-bases.xml.txt000066400000000000000000000107151514765374600245100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++17.Class-template-bases.xml.txt000066400000000000000000000066371514765374600263310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++20.Class-bases.xml.txt000066400000000000000000000107151514765374600245020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++20.Class-template-bases.xml.txt000066400000000000000000000066371514765374600263230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++23.Class-bases.xml.txt000066400000000000000000000107151514765374600245050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++23.Class-template-bases.xml.txt000066400000000000000000000066371514765374600263260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++98.CXXLiteral.result.txt000066400000000000000000000000021514765374600250420ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/gccxml.c++98.CXXLiteral.stderr.txt000066400000000000000000000000271514765374600250360ustar00rootroot00000000000000error: expected a type CastXML-CastXML-892090e/test/expect/gccxml.c++98.CXXLiteral.xml.txt000066400000000000000000000000141514765374600243270ustar00rootroot00000000000000\(missing\) CastXML-CastXML-892090e/test/expect/gccxml.c++98.Class-bases.xml.txt000066400000000000000000000111351514765374600245160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++98.Class-template-bases.xml.txt000066400000000000000000000070131514765374600263270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c++98.Function-rvalue-reference.stderr.txt000066400000000000000000000000631514765374600300740ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/gccxml.c++98.Method-rvalue-reference.stderr.txt000066400000000000000000000000631514765374600275270ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/gccxml.c++98.RValueReferenceType.stderr.txt000066400000000000000000000000631514765374600267360ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/gccxml.c++98.TypeAlias.stderr.txt000066400000000000000000000000641514765374600247530ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/gccxml.c++98.TypeAliasTemplate.stderr.txt000066400000000000000000000000641514765374600264470ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-CastXML-892090e/test/expect/gccxml.c.Atomic-int-const.xml.txt000066400000000000000000000005151514765374600251770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Atomic-int.xml.txt000066400000000000000000000004241514765374600240520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Atomic-ptr.xml.txt000066400000000000000000000004241514765374600240650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Atomic-struct.xml.txt000066400000000000000000000004271514765374600246070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Elaborated.xml.txt000066400000000000000000000005031514765374600241060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Function.xml.txt000066400000000000000000000006741514765374600236420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.FunctionNoProto.xml.txt000066400000000000000000000004631514765374600251570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.FundamentalType.xml.txt000066400000000000000000000004571514765374600251540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-_Float128.xml.txt000066400000000000000000000005731514765374600241410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-_Float32.xml.txt000066400000000000000000000005671514765374600240560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-_Float32x.xml.txt000066400000000000000000000005711514765374600242410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-_Float64.xml.txt000066400000000000000000000005671514765374600240630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-_Float64x.xml.txt000066400000000000000000000005731514765374600242500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-__float128-nostart.xml.txt000066400000000000000000000003011514765374600260150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-__float128.xml.txt000066400000000000000000000005751514765374600243420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-__float80.xml.txt000066400000000000000000000006011514765374600242450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-attr-assume.xml.txt000066400000000000000000000004641514765374600247460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-attr-malloc-args.xml.txt000066400000000000000000000007731514765374600256550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.GNU-va_arg_pack.xml.txt000066400000000000000000000006411514765374600247330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Typedef-called-class.xml.txt000066400000000000000000000006201514765374600257710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.Variable.xml.txt000066400000000000000000000004511514765374600235730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-CastXML-892090e/test/expect/gccxml.c.invalid.result.txt000066400000000000000000000000021514765374600242020ustar00rootroot000000000000001 CastXML-CastXML-892090e/test/expect/gccxml.c.invalid.stderr.txt000066400000000000000000000001101514765374600241670ustar00rootroot00000000000000error: (unknown type name 'class'|use of undeclared identifier 'class') CastXML-CastXML-892090e/test/input/000077500000000000000000000000001514765374600166605ustar00rootroot00000000000000CastXML-CastXML-892090e/test/input/ArrayType-incomplete.cxx000066400000000000000000000000251514765374600234560ustar00rootroot00000000000000typedef int start[]; CastXML-CastXML-892090e/test/input/ArrayType.cxx000066400000000000000000000000261514765374600213220ustar00rootroot00000000000000typedef int start[2]; CastXML-CastXML-892090e/test/input/Atomic-int-const.c000066400000000000000000000000411514765374600221470ustar00rootroot00000000000000typedef _Atomic int const start; CastXML-CastXML-892090e/test/input/Atomic-int-const.cxx000066400000000000000000000000411514765374600225270ustar00rootroot00000000000000typedef _Atomic int const start; CastXML-CastXML-892090e/test/input/Atomic-int.c000066400000000000000000000000331514765374600210240ustar00rootroot00000000000000typedef _Atomic int start; CastXML-CastXML-892090e/test/input/Atomic-int.cxx000066400000000000000000000000331514765374600214040ustar00rootroot00000000000000typedef _Atomic int start; CastXML-CastXML-892090e/test/input/Atomic-ptr.c000066400000000000000000000000341514765374600210400ustar00rootroot00000000000000typedef int* _Atomic start; CastXML-CastXML-892090e/test/input/Atomic-ptr.cxx000066400000000000000000000000341514765374600214200ustar00rootroot00000000000000typedef int* _Atomic start; CastXML-CastXML-892090e/test/input/Atomic-struct.c000066400000000000000000000000421514765374600215560ustar00rootroot00000000000000typedef _Atomic struct { } start; CastXML-CastXML-892090e/test/input/Atomic-struct.cxx000066400000000000000000000000421514765374600221360ustar00rootroot00000000000000typedef _Atomic struct { } start; CastXML-CastXML-892090e/test/input/CXXLiteral.cxx000066400000000000000000000001111514765374600213540ustar00rootroot00000000000000namespace start { unsigned long long operator""_u(unsigned long long); } CastXML-CastXML-892090e/test/input/Class-abstract.cxx000066400000000000000000000001461514765374600222530ustar00rootroot00000000000000class start { virtual int method(int) = 0; virtual operator int() = 0; virtual ~start() = 0; }; CastXML-CastXML-892090e/test/input/Class-annotate.cxx000066400000000000000000000000741514765374600222610ustar00rootroot00000000000000class __attribute__((annotate("an annotation"))) start { }; CastXML-CastXML-892090e/test/input/Class-base-offset.cxx000066400000000000000000000002361514765374600226460ustar00rootroot00000000000000class 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-CastXML-892090e/test/input/Class-base-typedef.cxx000066400000000000000000000001061514765374600230140ustar00rootroot00000000000000class base { }; typedef base base_t; class start : public base_t { }; CastXML-CastXML-892090e/test/input/Class-bases.cxx000066400000000000000000000002571514765374600215500ustar00rootroot00000000000000class base_public { }; class base_private { }; class base_protected { }; class start : public base_public , private base_private , virtual protected base_protected { }; CastXML-CastXML-892090e/test/input/Class-deprecated-long.cxx000066400000000000000000000003151514765374600235030ustar00rootroot00000000000000class __attribute__((deprecated( "Deprecated: Additional information about the deprecation of 'start'\ which spreads over multiple lines can be found \"online\" "))) start { }; CastXML-CastXML-892090e/test/input/Class-deprecated.cxx000066400000000000000000000001001514765374600225360ustar00rootroot00000000000000class __attribute__((deprecated("Class Deprecated"))) start { };CastXML-CastXML-892090e/test/input/Class-forward.cxx000066400000000000000000000001661514765374600221160ustar00rootroot00000000000000class start; class start { public: start(); start(start const&); start& operator=(start const&); ~start(); }; CastXML-CastXML-892090e/test/input/Class-friends.cxx000066400000000000000000000001251514765374600220770ustar00rootroot00000000000000class A { }; void f(void); class start { friend class A; friend void f(void); }; CastXML-CastXML-892090e/test/input/Class-implicit-member-access-mutable.cxx000066400000000000000000000002421514765374600264120ustar00rootroot00000000000000class base { protected: base(); ~base(); private: base(base const&); base& operator=(base const&); mutable int data; }; class start : public base { }; CastXML-CastXML-892090e/test/input/Class-implicit-member-access.cxx000066400000000000000000000002161514765374600247640ustar00rootroot00000000000000class base { protected: base(); ~base(); private: base(base const&); base& operator=(base const&); }; class start : public base { }; CastXML-CastXML-892090e/test/input/Class-implicit-member-array.cxx000066400000000000000000000000401514765374600246340ustar00rootroot00000000000000class start { int data[2]; }; CastXML-CastXML-892090e/test/input/Class-implicit-member-bad-base.cxx000066400000000000000000000002501514765374600251570ustar00rootroot00000000000000template class base { protected: T data; base(); void operator=(base const& a) { this->data = a.data; } }; class start : public base { }; CastXML-CastXML-892090e/test/input/Class-implicit-member-const-aggregate.cxx000066400000000000000000000000441514765374600265740ustar00rootroot00000000000000struct start { int const data; }; CastXML-CastXML-892090e/test/input/Class-implicit-member-const.cxx000066400000000000000000000000671514765374600246550ustar00rootroot00000000000000class start { int const data; public: start(); }; CastXML-CastXML-892090e/test/input/Class-implicit-member-reference.cxx000066400000000000000000000000611514765374600254570ustar00rootroot00000000000000class start { int& ref; public: start(); }; CastXML-CastXML-892090e/test/input/Class-implicit-members.cxx000066400000000000000000000001361514765374600237110ustar00rootroot00000000000000class start { start method(start const& x) { start s; s = x; return s; } }; CastXML-CastXML-892090e/test/input/Class-incomplete-twice.cxx000066400000000000000000000000461514765374600237170ustar00rootroot00000000000000namespace start { class A; class A; } CastXML-CastXML-892090e/test/input/Class-incomplete.cxx000066400000000000000000000000151514765374600226020ustar00rootroot00000000000000class start; CastXML-CastXML-892090e/test/input/Class-member-Struct-anonymous.cxx000066400000000000000000000000451514765374600252250ustar00rootroot00000000000000class start { struct { } s; }; CastXML-CastXML-892090e/test/input/Class-member-Union-anonymous.cxx000066400000000000000000000000441514765374600250300ustar00rootroot00000000000000class start { union { } u; }; CastXML-CastXML-892090e/test/input/Class-member-injected.cxx000066400000000000000000000002431514765374600235000ustar00rootroot00000000000000namespace start { class A { A method(A*, A**); A method(A&, A*&); A method(A&&, A*&&); }; A function(A*, A**); A function(A&, A*&); A function(A&&, A*&&); } CastXML-CastXML-892090e/test/input/Class-member-template-access.cxx000066400000000000000000000002561514765374600247710ustar00rootroot00000000000000class start { template class member { }; public: typedef member member_char; // incomplete }; template class start::member; // instantiation CastXML-CastXML-892090e/test/input/Class-member-template.cxx000066400000000000000000000002061514765374600235250ustar00rootroot00000000000000class start { template T method(T v) { return v; } }; template int start::method(int); // instantiation CastXML-CastXML-892090e/test/input/Class-ms-dllexport.cxx000066400000000000000000000000471514765374600231020ustar00rootroot00000000000000class __declspec(dllexport) start { }; CastXML-CastXML-892090e/test/input/Class-ms-dllimport.cxx000066400000000000000000000000471514765374600230730ustar00rootroot00000000000000class __declspec(dllimport) start { }; CastXML-CastXML-892090e/test/input/Class-partial-template-member-Typedef.cxx000066400000000000000000000002251514765374600265560ustar00rootroot00000000000000template class start; template class start { typedef T Int; public: T method(Int); }; template class start; CastXML-CastXML-892090e/test/input/Class-template-Method-Argument-const.cxx000066400000000000000000000001621514765374600264030ustar00rootroot00000000000000template class start { void method(T const&); }; template class start; // instantiation CastXML-CastXML-892090e/test/input/Class-template-Method-Argument-default.cxx000066400000000000000000000001541514765374600267020ustar00rootroot00000000000000template class start { int method(int = 123); }; template class start; // instantiation CastXML-CastXML-892090e/test/input/Class-template-Method-return-const.cxx000066400000000000000000000001551514765374600261420ustar00rootroot00000000000000template class start { T const method(); }; template class start; // instantiation CastXML-CastXML-892090e/test/input/Class-template-bases.cxx000066400000000000000000000003341514765374600233550ustar00rootroot00000000000000class non_dependent_base { }; template class dependent_base { }; template class start : public non_dependent_base , public dependent_base { }; template class start; // instantiation CastXML-CastXML-892090e/test/input/Class-template-constructor-template.cxx000066400000000000000000000002751514765374600264620ustar00rootroot00000000000000template class start { public: start(start const&); template start(start const&); }; start instantiate_and_copy(start const& x) { return x; } CastXML-CastXML-892090e/test/input/Class-template-friends.cxx000066400000000000000000000003271514765374600237140ustar00rootroot00000000000000template 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-CastXML-892090e/test/input/Class-template-member-Typedef-const.cxx000066400000000000000000000001751514765374600262540ustar00rootroot00000000000000template class start { typedef T IntConst; public: T method(IntConst); }; template class start; CastXML-CastXML-892090e/test/input/Class-template-member-Typedef.cxx000066400000000000000000000001551514765374600251260ustar00rootroot00000000000000template class start { typedef T Int; public: T method(Int); }; template class start; CastXML-CastXML-892090e/test/input/Class-template-member-nontemplate-Typedef.cxx000066400000000000000000000002341514765374600274500ustar00rootroot00000000000000template struct A { struct B { typedef int intermediate_type; typedef intermediate_type type; }; }; typedef A::B::type start; CastXML-CastXML-892090e/test/input/Class-template-member-template.cxx000066400000000000000000000002431514765374600253370ustar00rootroot00000000000000template class start { template T method(U) { return T(); } }; template int start::method(char); // instantiation CastXML-CastXML-892090e/test/input/Class-template-recurse.cxx000066400000000000000000000004501514765374600237270ustar00rootroot00000000000000template 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-CastXML-892090e/test/input/Class-template.cxx000066400000000000000000000004331514765374600222620ustar00rootroot00000000000000template class start { }; template struct start { }; // partial specialization template <> class start; // specialization template class start; // instantiation template class start; // instantiation of partial specialization CastXML-CastXML-892090e/test/input/Class.cxx000066400000000000000000000000211514765374600204420ustar00rootroot00000000000000class start { }; CastXML-CastXML-892090e/test/input/Comment-Class.cxx000066400000000000000000000000421514765374600220450ustar00rootroot00000000000000/** class comment */ class start; CastXML-CastXML-892090e/test/input/Comment-Enumeration.cxx000066400000000000000000000000711514765374600232700ustar00rootroot00000000000000/// enum comment /// with multiple lines enum start { }; CastXML-CastXML-892090e/test/input/Comment-Field.cxx000066400000000000000000000003711514765374600220300ustar00rootroot00000000000000class start { /** field comment */ int field; /// bit field comment unsigned bit_field : 2; //! mutable field comment mutable int mutable_field; public: start(start const&); start& operator=(start const&); start(); ~start(); }; CastXML-CastXML-892090e/test/input/Comment-Function-expansion.cxx000066400000000000000000000001011514765374600245630ustar00rootroot00000000000000#define COMMENT /** function comment */ COMMENT void start(int); CastXML-CastXML-892090e/test/input/Comment-Function-separated.cxx000066400000000000000000000001311514765374600245320ustar00rootroot00000000000000// Non-doc comment before. /** doc comment */ // Non-doc comment after. void start(int); CastXML-CastXML-892090e/test/input/Comment-Function.cxx000066400000000000000000000001011514765374600225610ustar00rootroot00000000000000/** function comment with multiple lines */ void start(int); CastXML-CastXML-892090e/test/input/Comment-Method.cxx000066400000000000000000000000741514765374600222250ustar00rootroot00000000000000class start { /** method comment */ int method(int); }; CastXML-CastXML-892090e/test/input/Comment-Namespace.cxx000066400000000000000000000001021514765374600226710ustar00rootroot00000000000000//! namespace comment //! with multiple lines namespace start { } CastXML-CastXML-892090e/test/input/Comment-TypeAlias.cxx000066400000000000000000000001001514765374600226660ustar00rootroot00000000000000namespace start { /** type alias comment */ using type = int; } CastXML-CastXML-892090e/test/input/Comment-Typedef.cxx000066400000000000000000000000521514765374600224010ustar00rootroot00000000000000/** typedef comment */ typedef int start; CastXML-CastXML-892090e/test/input/Comment-Variable.cxx000066400000000000000000000000731514765374600225310ustar00rootroot00000000000000/*! variable comment with multiple lines */ int start; CastXML-CastXML-892090e/test/input/Constructor-annotate.cxx000066400000000000000000000001071514765374600235360ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) start(); }; CastXML-CastXML-892090e/test/input/Constructor-deprecated.cxx000066400000000000000000000001221514765374600240220ustar00rootroot00000000000000class start { __attribute__((deprecated("Constructor Deprecated"))) start(); }; CastXML-CastXML-892090e/test/input/Constructor-ms-dllexport.cxx000066400000000000000000000000621514765374600243570ustar00rootroot00000000000000class start { __declspec(dllexport) start(); }; CastXML-CastXML-892090e/test/input/Constructor-ms-dllimport.cxx000066400000000000000000000000621514765374600243500ustar00rootroot00000000000000class start { __declspec(dllimport) start(); }; CastXML-CastXML-892090e/test/input/Constructor.cxx000066400000000000000000000000341514765374600217260ustar00rootroot00000000000000class start { start(); }; CastXML-CastXML-892090e/test/input/Converter-annotate.cxx000066400000000000000000000001161514765374600231600ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) operator int(); }; CastXML-CastXML-892090e/test/input/Converter-deprecated.cxx000066400000000000000000000001271514765374600234510ustar00rootroot00000000000000class start { __attribute__((deprecated("Converter Deprecated"))) operator int(); }; CastXML-CastXML-892090e/test/input/Converter-ms-dllexport.cxx000066400000000000000000000000711514765374600240010ustar00rootroot00000000000000class start { __declspec(dllexport) operator int(); }; CastXML-CastXML-892090e/test/input/Converter-ms-dllimport.cxx000066400000000000000000000000711514765374600237720ustar00rootroot00000000000000class start { __declspec(dllimport) operator int(); }; CastXML-CastXML-892090e/test/input/Converter.cxx000066400000000000000000000000431514765374600213500ustar00rootroot00000000000000class start { operator int(); }; CastXML-CastXML-892090e/test/input/CvQualifiedType.cxx000066400000000000000000000000311514765374600224340ustar00rootroot00000000000000typedef int const start; CastXML-CastXML-892090e/test/input/Destructor-annotate.cxx000066400000000000000000000001101514765374600233410ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) ~start(); }; CastXML-CastXML-892090e/test/input/Destructor-deprecated.cxx000066400000000000000000000001221514765374600236330ustar00rootroot00000000000000class start { __attribute__((deprecated("Destructor Deprecated"))) ~start(); }; CastXML-CastXML-892090e/test/input/Destructor-ms-dllexport.cxx000066400000000000000000000000631514765374600241710ustar00rootroot00000000000000class start { __declspec(dllexport) ~start(); }; CastXML-CastXML-892090e/test/input/Destructor-ms-dllimport.cxx000066400000000000000000000000631514765374600241620ustar00rootroot00000000000000class start { __declspec(dllimport) ~start(); }; CastXML-CastXML-892090e/test/input/Destructor.cxx000066400000000000000000000000351514765374600215400ustar00rootroot00000000000000class start { ~start(); }; CastXML-CastXML-892090e/test/input/Elaborated-ns.cxx000066400000000000000000000000561514765374600220650ustar00rootroot00000000000000namespace start { class A; start::A* f(A*); } CastXML-CastXML-892090e/test/input/Elaborated.c000066400000000000000000000000461514765374600210660ustar00rootroot00000000000000struct Foo; typedef struct Foo start; CastXML-CastXML-892090e/test/input/Elaborated.cxx000066400000000000000000000015731514765374600214540ustar00rootroot00000000000000namespace start { // Struct struct Foo1; Foo1* s1; struct Foo1* s2; // elaborated Foo1 const* s3; const struct Foo1* s4; // elaborated typedef Foo1* s5; typedef struct Foo1* s6; // elaborated // Enum enum Foo2 { }; Foo2* e1; enum Foo2* e2; // elaborated Foo2 const* e3; const enum Foo2* e4; // elaborated typedef Foo2* e5; typedef enum Foo2* e6; // elaborated // Union union Foo3 { }; Foo3* u1; union Foo3* u2; // elaborated Foo3 const* u3; const union Foo3* u4; // elaborated typedef Foo3* u5; typedef union Foo3* u6; // elaborated // Class class Foo4 { }; Foo4* c1; class Foo4* c2; // elaborated Foo3 const* 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-CastXML-892090e/test/input/Enumeration-annotate-multi.cxx000066400000000000000000000002331514765374600246270ustar00rootroot00000000000000enum __attribute__((annotate("an annotation"))) __attribute__((annotate("second annotation"))) start { ev0 __attribute__((annotate("an annotation"))) }; CastXML-CastXML-892090e/test/input/Enumeration-annotate.cxx000066400000000000000000000001541514765374600235010ustar00rootroot00000000000000enum __attribute__((annotate("an annotation"))) start { ev0 __attribute__((annotate("an annotation"))) }; CastXML-CastXML-892090e/test/input/Enumeration-anonymous.cxx000066400000000000000000000000531514765374600237160ustar00rootroot00000000000000namespace start { enum { ev0, ev1 }; } CastXML-CastXML-892090e/test/input/Enumeration-deprecated.cxx000066400000000000000000000002101514765374600237610ustar00rootroot00000000000000enum __attribute__((deprecated("Enumeration Deprecated"))) start { ev0 __attribute__((deprecated("Enumeration Value Deprecated"))) }; CastXML-CastXML-892090e/test/input/Enumeration-scoped.cxx000066400000000000000000000000421514765374600231410ustar00rootroot00000000000000enum class start { value = 1 }; CastXML-CastXML-892090e/test/input/Enumeration-type.cxx000066400000000000000000000000521514765374600226460ustar00rootroot00000000000000enum class start : short { value = 1 }; CastXML-CastXML-892090e/test/input/Enumeration.cxx000066400000000000000000000000411514765374600216650ustar00rootroot00000000000000enum start { ev0, ev2 = 2 }; CastXML-CastXML-892090e/test/input/Field-annotate.cxx000066400000000000000000000001111514765374600222270ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) int field; }; CastXML-CastXML-892090e/test/input/Field-deprecated.cxx000066400000000000000000000001161514765374600225230ustar00rootroot00000000000000class start { __attribute__((deprecated("Field Deprecated"))) int field; }; CastXML-CastXML-892090e/test/input/Field-init.cxx000066400000000000000000000001111514765374600213610ustar00rootroot00000000000000class start { int field_int = 123; char const* field_str = "abc"; }; CastXML-CastXML-892090e/test/input/Field.cxx000066400000000000000000000002561514765374600204320ustar00rootroot00000000000000class start { int field; unsigned bit_field : 2; mutable int mutable_field; public: start(start const&); start& operator=(start const&); start(); ~start(); }; CastXML-CastXML-892090e/test/input/Function-Argument-annotate.cxx000066400000000000000000000000741514765374600245610ustar00rootroot00000000000000void start(__attribute__((annotate("an annotation"))) int); CastXML-CastXML-892090e/test/input/Function-Argument-decay.cxx000066400000000000000000000000601514765374600240300ustar00rootroot00000000000000void start(int[4][3], int[2], int[], int(int)); CastXML-CastXML-892090e/test/input/Function-Argument-default-cast.cxx000066400000000000000000000006701514765374600253260ustar00rootroot00000000000000namespace 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-CastXML-892090e/test/input/Function-Argument-default-ns.cxx000066400000000000000000000002131514765374600250050ustar00rootroot00000000000000namespace start { static int const C = 0; static unsigned int const D = 0; enum { E = 0 }; void f(int = C, unsigned int = D, int = E); } CastXML-CastXML-892090e/test/input/Function-Argument-default.cxx000066400000000000000000000002061514765374600243710ustar00rootroot00000000000000void start(int, char const*); void start(int, char const* = "abc"); void start(int = 123, char const*); void start(int, char const*); CastXML-CastXML-892090e/test/input/Function-Argument-deprecated.cxx000066400000000000000000000001151514765374600250440ustar00rootroot00000000000000void start(__attribute__((deprecated("Function Argument Deprecated"))) int); CastXML-CastXML-892090e/test/input/Function-annotate.cxx000066400000000000000000000000741514765374600230010ustar00rootroot00000000000000__attribute__((annotate("an annotation"))) void start(int); CastXML-CastXML-892090e/test/input/Function-auto-undeduced.cxx000066400000000000000000000000161514765374600240720ustar00rootroot00000000000000auto start(); CastXML-CastXML-892090e/test/input/Function-auto.cxx000066400000000000000000000000351514765374600221350ustar00rootroot00000000000000auto start() { return 1; } CastXML-CastXML-892090e/test/input/Function-calling-convention-ms-annotate.cxx000066400000000000000000000005401514765374600272030ustar00rootroot00000000000000__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-CastXML-892090e/test/input/Function-calling-convention-ms-deprecated.cxx000066400000000000000000000006321514765374600274740ustar00rootroot00000000000000__attribute__((deprecated("Function Deprecated"))) void __cdecl start( void(__cdecl*)()); __attribute__((deprecated( "stdcall Function Deprecated"))) void __stdcall start(void(__stdcall*)()); __attribute__((deprecated( "fastcall Function Deprecated"))) void __fastcall start(void(__fastcall*)()); __attribute__((deprecated( "thiscall Function Deprecated"))) void __thiscall start(void(__thiscall*)()); CastXML-CastXML-892090e/test/input/Function-calling-convention-ms-dllexport.cxx000066400000000000000000000004001514765374600274020ustar00rootroot00000000000000__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-CastXML-892090e/test/input/Function-calling-convention-ms-dllimport.cxx000066400000000000000000000004001514765374600273730ustar00rootroot00000000000000__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-CastXML-892090e/test/input/Function-calling-convention-ms.cxx000066400000000000000000000002501514765374600253720ustar00rootroot00000000000000void __cdecl start(void(__cdecl*)()); void __stdcall start(void(__stdcall*)()); void __fastcall start(void(__fastcall*)()); void __thiscall start(void(__thiscall*)()); CastXML-CastXML-892090e/test/input/Function-deprecated.cxx000066400000000000000000000001041514765374600232620ustar00rootroot00000000000000__attribute__((deprecated("Function Deprecated"))) void start(int); CastXML-CastXML-892090e/test/input/Function-extern-C.cxx000066400000000000000000000000341514765374600226510ustar00rootroot00000000000000extern "C" void start(int); CastXML-CastXML-892090e/test/input/Function-lambda.cxx000066400000000000000000000001571514765374600224120ustar00rootroot00000000000000template F start(F f) { return f; } void instantiate_start_with_lambda() { start([]() {}); } CastXML-CastXML-892090e/test/input/Function-ms-dllexport.cxx000066400000000000000000000000471514765374600236220ustar00rootroot00000000000000__declspec(dllexport) void start(int); CastXML-CastXML-892090e/test/input/Function-ms-dllimport.cxx000066400000000000000000000000471514765374600236130ustar00rootroot00000000000000__declspec(dllimport) void start(int); CastXML-CastXML-892090e/test/input/Function-rvalue-reference.cxx000066400000000000000000000000711514765374600244170ustar00rootroot00000000000000int start(int); int start(int&&); int&& start(int, int); CastXML-CastXML-892090e/test/input/Function-template.cxx000066400000000000000000000002361514765374600230030ustar00rootroot00000000000000template T start(T) { return T(); } template <> char start(char); // specialization template int start(int); // instantiation CastXML-CastXML-892090e/test/input/Function-throw.cxx000066400000000000000000000000421514765374600223260ustar00rootroot00000000000000void start(int) throw(int, char); CastXML-CastXML-892090e/test/input/Function-variadic.cxx000066400000000000000000000000261514765374600227470ustar00rootroot00000000000000void start(int, ...); CastXML-CastXML-892090e/test/input/Function.c000066400000000000000000000000211514765374600206020ustar00rootroot00000000000000void start(int); CastXML-CastXML-892090e/test/input/Function.cxx000066400000000000000000000000211514765374600211620ustar00rootroot00000000000000void start(int); CastXML-CastXML-892090e/test/input/FunctionNoProto.c000066400000000000000000000000151514765374600221260ustar00rootroot00000000000000int start(); CastXML-CastXML-892090e/test/input/FunctionType-variadic.cxx000066400000000000000000000000361514765374600236120ustar00rootroot00000000000000typedef void start(int, ...); CastXML-CastXML-892090e/test/input/FunctionType.cxx000066400000000000000000000000311514765374600220250ustar00rootroot00000000000000typedef void start(int); CastXML-CastXML-892090e/test/input/FundamentalType-nullptr.cxx000066400000000000000000000001451514765374600242020ustar00rootroot00000000000000namespace start { typedef decltype(nullptr) t_NullPtr; typedef decltype((nullptr)) t_ParenNullPtr; } CastXML-CastXML-892090e/test/input/FundamentalType.c000066400000000000000000000000231514765374600221170ustar00rootroot00000000000000typedef int start; CastXML-CastXML-892090e/test/input/FundamentalType.cxx000066400000000000000000000000231514765374600224770ustar00rootroot00000000000000typedef int start; CastXML-CastXML-892090e/test/input/FundamentalTypes.cxx000066400000000000000000000005671514765374600226770ustar00rootroot00000000000000namespace 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-CastXML-892090e/test/input/GNU-_Float128.c000066400000000000000000000001311514765374600211050ustar00rootroot00000000000000_Float128 start(_Float128); __float128 conversions(__float128 x) { return start(x); } CastXML-CastXML-892090e/test/input/GNU-_Float128.cxx000066400000000000000000000003321514765374600214700ustar00rootroot00000000000000_Float128 start(_Float128); __float128 conversions(__float128 x) { return start(x); } template struct distinct; template <> struct distinct<__float128> { }; template <> struct distinct<_Float128> { }; CastXML-CastXML-892090e/test/input/GNU-_Float32.c000066400000000000000000000001151514765374600210210ustar00rootroot00000000000000_Float32 start(_Float32); float conversions(float x) { return start(x); } CastXML-CastXML-892090e/test/input/GNU-_Float32.cxx000066400000000000000000000003101514765374600213760ustar00rootroot00000000000000_Float32 start(_Float32); float conversions(float x) { return start(x); } template struct distinct; template <> struct distinct { }; template <> struct distinct<_Float32> { }; CastXML-CastXML-892090e/test/input/GNU-_Float32x.c000066400000000000000000000001211514765374600212060ustar00rootroot00000000000000_Float32x start(_Float32x); double conversions(double x) { return start(x); } CastXML-CastXML-892090e/test/input/GNU-_Float32x.cxx000066400000000000000000000003161514765374600215740ustar00rootroot00000000000000_Float32x start(_Float32x); double conversions(double x) { return start(x); } template struct distinct; template <> struct distinct { }; template <> struct distinct<_Float32x> { }; CastXML-CastXML-892090e/test/input/GNU-_Float64.c000066400000000000000000000001171514765374600210300ustar00rootroot00000000000000_Float64 start(_Float64); double conversions(double x) { return start(x); } CastXML-CastXML-892090e/test/input/GNU-_Float64.cxx000066400000000000000000000003131514765374600214060ustar00rootroot00000000000000_Float64 start(_Float64); double conversions(double x) { return start(x); } template struct distinct; template <> struct distinct { }; template <> struct distinct<_Float64> { }; CastXML-CastXML-892090e/test/input/GNU-_Float64x.c000066400000000000000000000001331514765374600212160ustar00rootroot00000000000000_Float64x start(_Float64x); long double conversions(long double x) { return start(x); } CastXML-CastXML-892090e/test/input/GNU-_Float64x.cxx000066400000000000000000000003351514765374600216020ustar00rootroot00000000000000_Float64x start(_Float64x); long double conversions(long double x) { return start(x); } template struct distinct; template <> struct distinct { }; template <> struct distinct<_Float64x> { }; CastXML-CastXML-892090e/test/input/GNU-__float128-nostart.c000066400000000000000000000000361514765374600230000ustar00rootroot00000000000000__float128 start(__float128); CastXML-CastXML-892090e/test/input/GNU-__float128-nostart.cxx000066400000000000000000000000361514765374600233600ustar00rootroot00000000000000__float128 start(__float128); CastXML-CastXML-892090e/test/input/GNU-__float128.c000066400000000000000000000000541514765374600213100ustar00rootroot00000000000000__float128 start(__float128); __float128 v; CastXML-CastXML-892090e/test/input/GNU-__float128.cxx000066400000000000000000000001571514765374600216740ustar00rootroot00000000000000template struct A; namespace start { __float128 f(__float128); __float128 v; A<__float128>* pa; } CastXML-CastXML-892090e/test/input/GNU-__float80.c000066400000000000000000000000341514765374600212230ustar00rootroot00000000000000__float80 start(__float80); CastXML-CastXML-892090e/test/input/GNU-__float80.cxx000066400000000000000000000000341514765374600216030ustar00rootroot00000000000000__float80 start(__float80); CastXML-CastXML-892090e/test/input/GNU-attr-assume.c000066400000000000000000000000671514765374600217230ustar00rootroot00000000000000void start(void) { __attribute__((__assume__(1))); } CastXML-CastXML-892090e/test/input/GNU-attr-assume.cxx000066400000000000000000000000671514765374600223030ustar00rootroot00000000000000void start(void) { __attribute__((__assume__(1))); } CastXML-CastXML-892090e/test/input/GNU-attr-malloc-args.c000066400000000000000000000002421514765374600226220ustar00rootroot00000000000000typedef struct foo_s { } foo; void foo_close(foo*); __attribute__((__malloc__, __malloc__(foo_close), __malloc__(foo_close, 1))) foo* start(void); CastXML-CastXML-892090e/test/input/GNU-attr-malloc-args.cxx000066400000000000000000000002241514765374600232020ustar00rootroot00000000000000struct foo { }; void foo_close(foo*); __attribute__((__malloc__, __malloc__(foo_close), __malloc__(foo_close, 1))) foo* start(void); CastXML-CastXML-892090e/test/input/GNU-va_arg_pack.c000066400000000000000000000001551514765374600217110ustar00rootroot00000000000000__inline int start(int n, ...) { return start(n + __builtin_va_arg_pack_len(), __builtin_va_arg_pack()); } CastXML-CastXML-892090e/test/input/GNU-va_arg_pack.cxx000066400000000000000000000001551514765374600222710ustar00rootroot00000000000000__inline int start(int n, ...) { return start(n + __builtin_va_arg_pack_len(), __builtin_va_arg_pack()); } CastXML-CastXML-892090e/test/input/Method-Argument-default-cast.cxx000066400000000000000000000002551514765374600247600ustar00rootroot00000000000000class start { class Class; typedef int Int; int f(Int = (Int)0, Class* = (Class*)0, Class* = static_cast(0), Class* = reinterpret_cast(0)); }; CastXML-CastXML-892090e/test/input/Method-Argument-default.cxx000066400000000000000000000001021514765374600240170ustar00rootroot00000000000000class start { static int const C = 0; int method(int = C); }; CastXML-CastXML-892090e/test/input/Method-annotate.cxx000066400000000000000000000001171514765374600224320ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) int method(int); }; CastXML-CastXML-892090e/test/input/Method-deprecated.cxx000066400000000000000000000001251514765374600227200ustar00rootroot00000000000000class start { __attribute__((deprecated("Method Deprecated"))) int method(int); }; CastXML-CastXML-892090e/test/input/Method-final.cxx000066400000000000000000000001431514765374600217110ustar00rootroot00000000000000class base { virtual int method(int); }; class start : public base { int method(int) final; }; CastXML-CastXML-892090e/test/input/Method-ms-dllexport.cxx000066400000000000000000000000721514765374600232530ustar00rootroot00000000000000class start { __declspec(dllexport) int method(int); }; CastXML-CastXML-892090e/test/input/Method-ms-dllimport.cxx000066400000000000000000000000721514765374600232440ustar00rootroot00000000000000class start { __declspec(dllimport) int method(int); }; CastXML-CastXML-892090e/test/input/Method-override.cxx000066400000000000000000000001461514765374600224420ustar00rootroot00000000000000class base { virtual int method(int); }; class start : public base { int method(int) override; }; CastXML-CastXML-892090e/test/input/Method-overrides.cxx000066400000000000000000000001451514765374600226240ustar00rootroot00000000000000class base { virtual int method(int); }; class start : public base { virtual int method(int); }; CastXML-CastXML-892090e/test/input/Method-rvalue-reference.cxx000066400000000000000000000002571514765374600240600ustar00rootroot00000000000000class start { start(start&); start(start&&); start& operator=(start&); start& operator=(start&&); int method(int); int method(int&&); int&& method(int, int); }; CastXML-CastXML-892090e/test/input/Method.cxx000066400000000000000000000000441514765374600206220ustar00rootroot00000000000000class start { int method(int); }; CastXML-CastXML-892090e/test/input/MethodType-cv.cxx000066400000000000000000000001051514765374600220700ustar00rootroot00000000000000class A; typedef int (A::*const volatile start)(int) const volatile; CastXML-CastXML-892090e/test/input/MethodType.cxx000066400000000000000000000000471514765374600214670ustar00rootroot00000000000000class A; typedef int (A::*start)(int); CastXML-CastXML-892090e/test/input/Namespace-Class-members.cxx000066400000000000000000000001011514765374600237630ustar00rootroot00000000000000namespace start { class A { static int data; }; int A::data; } CastXML-CastXML-892090e/test/input/Namespace-Class-partial-template-members.cxx000066400000000000000000000002241514765374600272340ustar00rootroot00000000000000namespace start { template class A; template class A { static int data; }; template int A::data; } CastXML-CastXML-892090e/test/input/Namespace-Class-template-members.cxx000066400000000000000000000001601514765374600256010ustar00rootroot00000000000000namespace start { template class A { static int data; }; template int A::data; } CastXML-CastXML-892090e/test/input/Namespace-Function-template-members.cxx000066400000000000000000000000711514765374600263220ustar00rootroot00000000000000namespace start { template T function(T); } CastXML-CastXML-892090e/test/input/Namespace-anonymous.cxx000066400000000000000000000000541514765374600233250ustar00rootroot00000000000000namespace start { namespace { struct A; } } CastXML-CastXML-892090e/test/input/Namespace-empty.cxx000066400000000000000000000000261514765374600224320ustar00rootroot00000000000000namespace start { ; } CastXML-CastXML-892090e/test/input/Namespace-extern-C-members.cxx000066400000000000000000000001071514765374600244110ustar00rootroot00000000000000namespace start { extern "C" { typedef int Int; Int function(Int); } } CastXML-CastXML-892090e/test/input/Namespace-inline-start.cxx000066400000000000000000000001211514765374600237010ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wc++11-extensions" inline namespace start { } CastXML-CastXML-892090e/test/input/Namespace-inline-template.cxx000066400000000000000000000002421514765374600243630ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wc++11-extensions" namespace start { inline namespace level1 { struct A; } template struct B; typedef B B_A; } CastXML-CastXML-892090e/test/input/Namespace-inline.cxx000066400000000000000000000002261514765374600225540ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wc++11-extensions" namespace start { inline namespace level1 { struct A; inline namespace level2 { struct B; } } } CastXML-CastXML-892090e/test/input/Namespace-nested.cxx000066400000000000000000000001531514765374600225570ustar00rootroot00000000000000namespace start { namespace ns1 { void f1(); } namespace ns2 { void f2(); } namespace ns3 { void f3(); } } CastXML-CastXML-892090e/test/input/Namespace-repeat-start.cxx000066400000000000000000000000761514765374600237140ustar00rootroot00000000000000namespace start { void f1(); } namespace start { void f2(); } CastXML-CastXML-892090e/test/input/Namespace-repeat.cxx000066400000000000000000000001141514765374600225520ustar00rootroot00000000000000namespace start { namespace ns { void f1(); } namespace ns { void f2(); } } CastXML-CastXML-892090e/test/input/Namespace.cxx000066400000000000000000000000241514765374600212740ustar00rootroot00000000000000namespace start { } CastXML-CastXML-892090e/test/input/OffsetType-cv.cxx000066400000000000000000000000761514765374600221050ustar00rootroot00000000000000class A; typedef int const volatile A::*const volatile start; CastXML-CastXML-892090e/test/input/OffsetType.cxx000066400000000000000000000000401514765374600214660ustar00rootroot00000000000000class A; typedef int A::*start; CastXML-CastXML-892090e/test/input/OperatorFunction-annotate.cxx000066400000000000000000000001401514765374600245070ustar00rootroot00000000000000class A; namespace start { __attribute__((annotate("an annotation"))) A& operator<<(A&, int); } CastXML-CastXML-892090e/test/input/OperatorFunction-deprecated.cxx000066400000000000000000000002711514765374600250030ustar00rootroot00000000000000class A; namespace start { __attribute__((deprecated("OperatorFunction Deprecated"))) A& operator<<(A&, int); } CastXML-CastXML-892090e/test/input/OperatorFunction-ms-dllexport.cxx000066400000000000000000000001131514765374600253300ustar00rootroot00000000000000class A; namespace start { __declspec(dllexport) A& operator<<(A&, int); } CastXML-CastXML-892090e/test/input/OperatorFunction-ms-dllimport.cxx000066400000000000000000000001131514765374600253210ustar00rootroot00000000000000class A; namespace start { __declspec(dllimport) A& operator<<(A&, int); } CastXML-CastXML-892090e/test/input/OperatorFunction.cxx000066400000000000000000000000651514765374600227060ustar00rootroot00000000000000class A; namespace start { A& operator<<(A&, int); } CastXML-CastXML-892090e/test/input/OperatorMethod-annotate.cxx000066400000000000000000000001261514765374600241460ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) start& operator<<(int); }; CastXML-CastXML-892090e/test/input/OperatorMethod-deprecated.cxx000066400000000000000000000001511514765374600244330ustar00rootroot00000000000000class start { __attribute__((deprecated("OperatorMethod Deprecated"))) start& operator<<( int); }; CastXML-CastXML-892090e/test/input/OperatorMethod-ms-dllexport.cxx000066400000000000000000000001011514765374600247600ustar00rootroot00000000000000class start { __declspec(dllexport) start& operator<<(int); }; CastXML-CastXML-892090e/test/input/OperatorMethod-ms-dllimport.cxx000066400000000000000000000001011514765374600247510ustar00rootroot00000000000000class start { __declspec(dllimport) start& operator<<(int); }; CastXML-CastXML-892090e/test/input/OperatorMethod.cxx000066400000000000000000000000531514765374600223360ustar00rootroot00000000000000class start { start& operator<<(int); }; CastXML-CastXML-892090e/test/input/PointerType.cxx000066400000000000000000000000241514765374600216620ustar00rootroot00000000000000typedef int* start; CastXML-CastXML-892090e/test/input/RValueReferenceType.cxx000066400000000000000000000000501514765374600232560ustar00rootroot00000000000000namespace start { typedef int&& type; } CastXML-CastXML-892090e/test/input/ReferenceType-to-Class-template.cxx000066400000000000000000000001641514765374600254410ustar00rootroot00000000000000template class A { }; void start(A&, short); void start(A&, int); void start(A&, long); CastXML-CastXML-892090e/test/input/ReferenceType.cxx000066400000000000000000000000241514765374600221400ustar00rootroot00000000000000typedef int& start; CastXML-CastXML-892090e/test/input/TypeAlias.cxx000066400000000000000000000000461514765374600212770ustar00rootroot00000000000000namespace start { using type = int; } CastXML-CastXML-892090e/test/input/TypeAliasTemplate.cxx000066400000000000000000000002021514765374600227650ustar00rootroot00000000000000template struct A { typedef T type; }; namespace start { template using type = typename A::type; } CastXML-CastXML-892090e/test/input/Typedef-annotate.cxx000066400000000000000000000000771514765374600226170ustar00rootroot00000000000000typedef int(start) __attribute__((annotate("an annotation"))); CastXML-CastXML-892090e/test/input/Typedef-called-class.c000066400000000000000000000000501514765374600227440ustar00rootroot00000000000000typedef int class; typedef class start; CastXML-CastXML-892090e/test/input/Typedef-deprecated.cxx000066400000000000000000000001661514765374600231050ustar00rootroot00000000000000typedef int(start) __attribute__((deprecated("Typedef Deprecated"))); typedef int(start) __attribute__((deprecated)); CastXML-CastXML-892090e/test/input/Typedef-paren.cxx000066400000000000000000000000241514765374600221030ustar00rootroot00000000000000typedef int(start); CastXML-CastXML-892090e/test/input/Typedef-to-Class-template.cxx000066400000000000000000000000651514765374600243010ustar00rootroot00000000000000template class A; typedef A start; CastXML-CastXML-892090e/test/input/Typedef-to-Enumeration-anonymous.cxx000066400000000000000000000000301514765374600257270ustar00rootroot00000000000000typedef enum { } start; CastXML-CastXML-892090e/test/input/Typedef-to-Enumeration.cxx000066400000000000000000000000351514765374600237060ustar00rootroot00000000000000enum E { }; typedef E start; CastXML-CastXML-892090e/test/input/Typedef-to-FundamentalType-mode.cxx000066400000000000000000000000651514765374600254450ustar00rootroot00000000000000typedef int start __attribute__((__mode__(__HI__))); CastXML-CastXML-892090e/test/input/Typedef-to-Struct-anonymous.cxx000066400000000000000000000000321514765374600247270ustar00rootroot00000000000000typedef struct { } start; CastXML-CastXML-892090e/test/input/Typedef-to-Union-anonymous.cxx000066400000000000000000000000311514765374600245320ustar00rootroot00000000000000typedef union { } start; CastXML-CastXML-892090e/test/input/Typedef-to-extern-C-FundamentalType-mode.cxx000066400000000000000000000001041514765374600271220ustar00rootroot00000000000000extern "C" { typedef int start __attribute__((__mode__(__HI__))); } CastXML-CastXML-892090e/test/input/Variable-annotate.cxx000066400000000000000000000000661514765374600227420ustar00rootroot00000000000000__attribute__((annotate("an annotation"))) int start; CastXML-CastXML-892090e/test/input/Variable-deprecated.cxx000066400000000000000000000000761514765374600232320ustar00rootroot00000000000000__attribute__((deprecated("Variable Deprecated"))) int start; CastXML-CastXML-892090e/test/input/Variable-extern-C.cxx000066400000000000000000000000551514765374600226140ustar00rootroot00000000000000namespace start { extern "C" int variable; } CastXML-CastXML-892090e/test/input/Variable-in-Class.cxx000066400000000000000000000000541514765374600225770ustar00rootroot00000000000000class start { static int static_field; }; CastXML-CastXML-892090e/test/input/Variable-init-cast.cxx000066400000000000000000000001431514765374600230200ustar00rootroot00000000000000namespace start { typedef int Int; int var_int = (Int)123; int var_int2 = static_cast(123); } CastXML-CastXML-892090e/test/input/Variable-init-ns.cxx000066400000000000000000000000771514765374600225140ustar00rootroot00000000000000namespace start { static int const C = 123; int var_int = C; } CastXML-CastXML-892090e/test/input/Variable-init.cxx000066400000000000000000000001041514765374600220650ustar00rootroot00000000000000namespace start { int var_int = 123; char const* var_str = "abc"; } CastXML-CastXML-892090e/test/input/Variable-lambda.cxx000066400000000000000000000000261514765374600223450ustar00rootroot00000000000000auto start = []() {}; CastXML-CastXML-892090e/test/input/Variable-ms-dllexport.cxx000066400000000000000000000000411514765374600235540ustar00rootroot00000000000000__declspec(dllexport) int start; CastXML-CastXML-892090e/test/input/Variable-ms-dllimport.cxx000066400000000000000000000000411514765374600235450ustar00rootroot00000000000000__declspec(dllimport) int start; CastXML-CastXML-892090e/test/input/Variable.c000066400000000000000000000000131514765374600205430ustar00rootroot00000000000000int start; CastXML-CastXML-892090e/test/input/Variable.cxx000066400000000000000000000000131514765374600211230ustar00rootroot00000000000000int start; CastXML-CastXML-892090e/test/input/assume_aligned.cxx000066400000000000000000000004211514765374600223610ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wundefined-inline" constexpr void* __cdecl __builtin_assume_aligned(void const*, size_t, ...) noexcept; int* check_assume_aligned(int* p) { __builtin_assume_aligned(p, 4); return p; } CastXML-CastXML-892090e/test/input/empty.c000066400000000000000000000000001514765374600201500ustar00rootroot00000000000000CastXML-CastXML-892090e/test/input/empty.cxx000066400000000000000000000000001514765374600205300ustar00rootroot00000000000000CastXML-CastXML-892090e/test/input/empty.m000066400000000000000000000000001514765374600201620ustar00rootroot00000000000000CastXML-CastXML-892090e/test/input/empty.mm000066400000000000000000000000001514765374600203370ustar00rootroot00000000000000CastXML-CastXML-892090e/test/input/empty.rsp000066400000000000000000000000001514765374600205320ustar00rootroot00000000000000CastXML-CastXML-892090e/test/input/fbracket-depth.c000066400000000000000000000011771514765374600217150ustar00rootroot00000000000000enum fbracket_depth { value = (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) }; CastXML-CastXML-892090e/test/input/has_unique_object_representations.cxx000066400000000000000000000001361514765374600264000ustar00rootroot00000000000000template struct Bool; typedef Bool<__has_unique_object_representations(int)> BoolType; CastXML-CastXML-892090e/test/input/implicit-decl-ms.cxx000066400000000000000000000000261514765374600225360ustar00rootroot00000000000000size_t start(size_t); CastXML-CastXML-892090e/test/input/inline-asm-ms.cxx000066400000000000000000000000431514765374600220520ustar00rootroot00000000000000void start() { __asm { int 1 } } CastXML-CastXML-892090e/test/input/intrinsics-arm64v8.cxx000066400000000000000000000003331514765374600227750ustar00rootroot00000000000000#if !defined(__ARM_ARCH) || __ARM_ARCH != 8 # error "__ARM_ARCH is incorrectly not defined to 8" #endif #ifndef __ARM_FEATURE_DIRECTED_ROUNDING # error "__ARM_FEATURE_DIRECTED_ROUNDING incorrectly not defined" #endif CastXML-CastXML-892090e/test/input/intrinsics-armv7.cxx000066400000000000000000000003261514765374600226240ustar00rootroot00000000000000#if !defined(__ARM_ARCH) || __ARM_ARCH != 7 # error "__ARM_ARCH is incorrectly not defined to 7" #endif #ifdef __ARM_FEATURE_DIRECTED_ROUNDING # error "__ARM_FEATURE_DIRECTED_ROUNDING incorrectly defined" #endif CastXML-CastXML-892090e/test/input/invalid-decl-for-type.cxx000066400000000000000000000002671514765374600235070ustar00rootroot00000000000000template struct A { T x; }; template struct B { B() { A a; } }; struct Incomplete; struct start { B b; typedef A type; }; CastXML-CastXML-892090e/test/input/invalid.c000066400000000000000000000000151514765374600204460ustar00rootroot00000000000000class start; CastXML-CastXML-892090e/test/input/make_integer_seq.cxx000066400000000000000000000004071514765374600227070ustar00rootroot00000000000000template struct seq; typedef __make_integer_seq seq_A; typedef seq seq_B; template struct assert_same; template struct assert_same { }; assert_same enforce; CastXML-CastXML-892090e/test/input/nostart.cxx000066400000000000000000000000341514765374600210730ustar00rootroot00000000000000class A; A operator+(A, A); CastXML-CastXML-892090e/test/input/o-missing.rsp000066400000000000000000000000031514765374600213040ustar00rootroot00000000000000-o CastXML-CastXML-892090e/test/input/predefined.c000066400000000000000000000000301514765374600211220ustar00rootroot00000000000000#include "predefined.h" CastXML-CastXML-892090e/test/input/predefined.cxx000066400000000000000000000000301514765374600215020ustar00rootroot00000000000000#include "predefined.h" CastXML-CastXML-892090e/test/input/predefined.h000066400000000000000000000015041514765374600211360ustar00rootroot00000000000000#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-CastXML-892090e/test/input/qualified-type-name.cxx000066400000000000000000000000731514765374600232440ustar00rootroot00000000000000namespace ns { typedef int type; } typedef ns::type start; CastXML-CastXML-892090e/test/input/using-declaration-class.cxx000066400000000000000000000001501514765374600241130ustar00rootroot00000000000000class base { protected: int f(int); }; class start : public base { using base::f; int f(char); }; CastXML-CastXML-892090e/test/input/using-declaration-ns.cxx000066400000000000000000000000651514765374600234330ustar00rootroot00000000000000class A; namespace start { using ::A; typedef A B; } CastXML-CastXML-892090e/test/input/using-declaration-start.cxx000066400000000000000000000000551514765374600241470ustar00rootroot00000000000000namespace N { class start; } using N::start; CastXML-CastXML-892090e/test/input/using-directive-ns.cxx000066400000000000000000000001001514765374600231120ustar00rootroot00000000000000namespace N { class A; } namespace start { using namespace N; } CastXML-CastXML-892090e/test/input/using-directive-start.cxx000066400000000000000000000000601514765374600236340ustar00rootroot00000000000000namespace A { class start; } using namespace A; CastXML-CastXML-892090e/test/run.cmake000066400000000000000000000134431514765374600173340ustar00rootroot00000000000000#============================================================================= # 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 # # https://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 3.10) 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}") if (o STREQUAL "xml") # C++98 adds throw="" to artificial members. Later standards do not. # Filter this out if not expecting C++98-specific output. if (NOT expect_xml_file MATCHES "\\.c\\+\\+98\\.") string(REGEX REPLACE "artificial=\"1\" throw=\"\"" "artificial=\"1\"" actual_xml "${actual_xml}") endif() endif() 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 "size=\"[0-9]+\" align=\"[0-9]+\"" "size=\"[0-9]+\" align=\"[0-9]+\"" update_xml "${update_xml}") string(REGEX REPLACE "" "" update_xml "${update_xml}") string(REGEX REPLACE "]*) offset=\"[1-9][0-9]*\"/>" "" 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 --schema "${schema}" "${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()