From 563c76556020418c03a636fa9edc84201622457e Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 19 Jul 2023 14:25:26 -0700 Subject: [PATCH 1/3] Move to LLVM's license, delete LLVMBuild files --- LICENSE | 61 ---- LICENSE.TXT | 281 ++++++++++++++++++ lib/Target/CBackend/CBackend.cpp | 5 +- lib/Target/CBackend/CBackend.h | 15 + lib/Target/CBackend/CTargetMachine.cpp | 5 +- lib/Target/CBackend/CTargetMachine.h | 5 +- lib/Target/CBackend/IDMap.h | 10 + lib/Target/CBackend/LLVMBuild.txt | 31 -- .../TargetInfo/CBackendTargetInfo.cpp | 5 +- lib/Target/CBackend/TargetInfo/LLVMBuild.txt | 23 -- lib/Target/CBackend/TopologicalSorter.cpp | 5 +- lib/Target/CBackend/TopologicalSorter.h | 5 +- runtime/windows/atomics.c | 10 + .../compound_types/test_array_of_structs.c | 5 +- .../compound_types/test_get_array_element.c | 5 +- .../compound_types/test_get_struct_member.c | 5 +- .../compound_types/test_get_union_member.c | 5 +- .../compound_types/test_nested_struct.c | 5 +- .../compound_types/test_self_ref_struct.c | 5 +- .../test_sizeof_packed_struct.c | 5 +- .../compound_types/test_sizeof_union.c | 5 +- .../compound_types/test_two_dim_array.c | 5 +- .../test_two_dim_array_pointer.c | 5 +- .../compound_types/test_typedef_struct.c | 5 +- .../compound_types/test_zero_length_array.c | 5 +- test/c_tests/declarations/test_declare_char.c | 5 +- .../declarations/test_declare_double.c | 5 +- .../c_tests/declarations/test_declare_float.c | 5 +- test/c_tests/declarations/test_declare_int.c | 5 +- test/c_tests/declarations/test_declare_long.c | 5 +- .../declarations/test_declare_long_double.c | 5 +- .../declarations/test_declare_long_int.c | 5 +- .../declarations/test_declare_long_long.c | 5 +- .../declarations/test_declare_long_long_int.c | 5 +- .../c_tests/declarations/test_declare_short.c | 5 +- .../declarations/test_declare_short_int.c | 5 +- .../declarations/test_declare_signed_char.c | 5 +- .../declarations/test_declare_signed_int.c | 5 +- .../declarations/test_declare_signed_long.c | 5 +- .../test_declare_signed_long_int.c | 5 +- .../test_declare_signed_long_long.c | 5 +- .../test_declare_signed_long_long_int.c | 5 +- .../declarations/test_declare_signed_short.c | 5 +- .../test_declare_signed_short_int.c | 5 +- .../declarations/test_declare_unsigned_char.c | 5 +- .../declarations/test_declare_unsigned_int.c | 5 +- .../declarations/test_declare_unsigned_long.c | 5 +- .../test_declare_unsigned_long_int.c | 5 +- .../test_declare_unsigned_long_long.c | 5 +- .../test_declare_unsigned_long_long_int.c | 5 +- .../test_declare_unsigned_short.c | 5 +- .../test_declare_unsigned_short_int.c | 5 +- .../test_declare_volatile_unsigned_int.c | 5 +- ...test_casted_nested_function_ptr_argument.c | 5 +- .../functions/test_fibonacci_function.c | 5 +- test/c_tests/functions/test_function_ptr.c | 5 +- .../functions/test_function_ptr_argument.c | 5 +- test/c_tests/functions/test_head_recursion.c | 5 +- .../test_nested_function_ptr_argument.c | 5 +- .../functions/test_recursive_function.c | 5 +- test/c_tests/functions/test_simple_function.c | 5 +- test/c_tests/functions/test_static_function.c | 5 +- .../functions/test_struct_function_argument.c | 5 +- test/c_tests/functions/test_tail_recursion.c | 5 +- .../test_zero_length_array_argument.c | 5 +- test/c_tests/operators/test_add_int_vars.c | 5 +- test/c_tests/operators/test_bitwise_and.c | 5 +- test/c_tests/operators/test_bitwise_not.c | 5 +- test/c_tests/operators/test_bitwise_or.c | 5 +- test/c_tests/operators/test_bitwise_shl.c | 5 +- test/c_tests/operators/test_bitwise_shr.c | 5 +- test/c_tests/operators/test_bitwise_xor.c | 5 +- .../operators/test_compound_add_assign.c | 5 +- .../test_compound_bitwise_and_assign.c | 5 +- .../test_compound_bitwise_or_assign.c | 5 +- .../test_compound_bitwise_xor_assign.c | 5 +- .../operators/test_compound_divide_assign.c | 5 +- .../operators/test_compound_modulus_assign.c | 5 +- .../operators/test_compound_multiply_assign.c | 5 +- .../operators/test_compound_shl_assign.c | 5 +- .../operators/test_compound_shr_assign.c | 5 +- .../operators/test_compound_subtract_assign.c | 5 +- test/c_tests/operators/test_divide_int_vars.c | 5 +- test/c_tests/operators/test_equal_operator.c | 5 +- test/c_tests/operators/test_greater_than.c | 5 +- .../operators/test_greater_than_or_equal.c | 5 +- test/c_tests/operators/test_less_than.c | 5 +- .../operators/test_less_than_or_equal.c | 5 +- test/c_tests/operators/test_logical_and.c | 5 +- test/c_tests/operators/test_logical_or.c | 5 +- .../c_tests/operators/test_modulus_int_vars.c | 5 +- .../operators/test_multiply_int_vars.c | 5 +- .../operators/test_not_equal_operator.c | 5 +- test/c_tests/operators/test_postincrement.c | 5 +- test/c_tests/operators/test_preincrement.c | 5 +- .../operators/test_subtract_int_vars.c | 5 +- test/c_tests/operators/test_unary_minus_int.c | 5 +- test/c_tests/operators/test_unary_plus_char.c | 5 +- test/c_tests/other/test_macro_substitution.c | 5 +- test/c_tests/other/test_mutual_ref_globals.c | 5 +- test/c_tests/other/test_null_is_0.c | 5 +- test/c_tests/other/test_register_vars.c | 5 +- test/c_tests/other/test_return_success.c | 5 +- test/c_tests/other/test_static_vars.c | 5 +- test/c_tests/other/test_test_failure.c | 5 +- .../pointers/test_address_of_operator.c | 5 +- .../pointers/test_char_sized_ptr_math_decr.c | 5 +- .../pointers/test_char_sized_ptr_math_incr.c | 5 +- test/c_tests/pointers/test_deref_array_item.c | 5 +- test/c_tests/pointers/test_deref_char_ptr.c | 5 +- test/c_tests/pointers/test_deref_double_ptr.c | 5 +- test/c_tests/pointers/test_deref_float_ptr.c | 5 +- test/c_tests/pointers/test_deref_int_ptr.c | 5 +- test/c_tests/pointers/test_deref_struct_ptr.c | 5 +- .../pointers/test_int_sized_ptr_math_decr.c | 5 +- .../pointers/test_int_sized_ptr_math_incr.c | 5 +- test/c_tests/statements/test_break_stmt.c | 5 +- test/c_tests/statements/test_goto_stmt.c | 5 +- .../c_tests/statements/test_nested_for_loop.c | 5 +- .../statements/test_nested_switch_stmt.c | 5 +- .../statements/test_nested_while_loop.c | 5 +- .../c_tests/statements/test_simple_do_while.c | 5 +- .../c_tests/statements/test_simple_for_loop.c | 5 +- test/c_tests/statements/test_simple_if_else.c | 5 +- .../statements/test_simple_if_else_use_else.c | 5 +- test/c_tests/statements/test_simple_if_stmt.c | 5 +- .../statements/test_simple_switch_stmt.c | 5 +- .../statements/test_simple_while_loop.c | 5 +- test/c_tests/stdatomic/test_atomic_fence.c | 5 +- tools/llvm-cbe/LLVMBuild.txt | 37 --- tools/llvm-cbe/llvm-cbe.cpp | 5 +- 131 files changed, 685 insertions(+), 398 deletions(-) delete mode 100644 LICENSE create mode 100644 LICENSE.TXT delete mode 100644 lib/Target/CBackend/LLVMBuild.txt delete mode 100644 lib/Target/CBackend/TargetInfo/LLVMBuild.txt delete mode 100644 tools/llvm-cbe/LLVMBuild.txt diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4b80826b..00000000 --- a/LICENSE +++ /dev/null @@ -1,61 +0,0 @@ -All changes to LLVM-CBE contributed by Julia Computing are made available under -the original University of Illinois/NCSA Open Source License. -Copyright(c) 2015-2021 Julia Computing and contributors. - -============================================================================== -LLVM Release License -============================================================================== -University of Illinois/NCSA -Open Source License -Copyright (c) 2003-2014 University of Illinois at Urbana-Champaign. -All rights reserved. -Developed by: -LLVM Team -University of Illinois at Urbana-Champaign -http://llvm.org -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal with -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -* Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimers. -* Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimers in the -documentation and/or other materials provided with the distribution. -* Neither the names of the LLVM Team, University of Illinois at -Urbana-Champaign, nor the names of its contributors may be used to -endorse or promote products derived from this Software without specific -prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE -SOFTWARE. -============================================================================== -Copyrights and Licenses for Third Party Software Distributed with LLVM: -============================================================================== -The LLVM software contains code written by third parties. Such software will -have its own individual LICENSE.TXT file in the directory in which it appears. -This file will describe the copyrights, license, and restrictions which apply -to that code. -The disclaimer of warranty in the University of Illinois Open Source License -applies to all code in the LLVM Distribution, and nothing in any of the -other licenses gives permission to use the names of the LLVM Team or the -University of Illinois to endorse or promote products derived from this -Software. -The following pieces of software have additional or alternate copyrights, -licenses, and/or restrictions: -Program Directory -------- --------- -Autoconf llvm/autoconf -llvm/projects/ModuleMaker/autoconf -llvm/projects/sample/autoconf -Google Test llvm/utils/unittest/googletest -OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} -pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} -ARM contributions llvm/lib/Target/ARM/LICENSE.TXT -md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 00000000..26dab5af --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,281 @@ +============================================================================== +All changes to LLVM-CBE contributed by Julia Computing are made available under +the original Apache License v2.0 with LLVM Exceptions. +Copyright(c) 2015-2023 Julia Computing and contributors. +============================================================================== + + 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. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index dc68dada..9b35e311 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/lib/Target/CBackend/CBackend.h b/lib/Target/CBackend/CBackend.h index 8abe8952..ca405e57 100644 --- a/lib/Target/CBackend/CBackend.h +++ b/lib/Target/CBackend/CBackend.h @@ -1,3 +1,18 @@ +/===-- CBackend.h - Library for converting LLVM code to C ----------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This library converts LLVM code to C code, compilable by GCC and other C +// compilers. +// +//===----------------------------------------------------------------------===// + #include "CTargetMachine.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallSet.h" diff --git a/lib/Target/CBackend/CTargetMachine.cpp b/lib/Target/CBackend/CTargetMachine.cpp index 1af8ae2a..432fa68a 100644 --- a/lib/Target/CBackend/CTargetMachine.cpp +++ b/lib/Target/CBackend/CTargetMachine.cpp @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/lib/Target/CBackend/CTargetMachine.h b/lib/Target/CBackend/CTargetMachine.h index e2100b20..73247c80 100644 --- a/lib/Target/CBackend/CTargetMachine.h +++ b/lib/Target/CBackend/CTargetMachine.h @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/lib/Target/CBackend/IDMap.h b/lib/Target/CBackend/IDMap.h index 8b0d19f9..078a4a10 100644 --- a/lib/Target/CBackend/IDMap.h +++ b/lib/Target/CBackend/IDMap.h @@ -1,3 +1,13 @@ +//===------------------ IDMap.h----------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + #include "llvm/ADT/DenseMap.h" namespace llvm_cbe { diff --git a/lib/Target/CBackend/LLVMBuild.txt b/lib/Target/CBackend/LLVMBuild.txt deleted file mode 100644 index 8a67ab0f..00000000 --- a/lib/Target/CBackend/LLVMBuild.txt +++ /dev/null @@ -1,31 +0,0 @@ -;===- ./lib/Target/CBackend/LLVMBuild.txt ----------------------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[common] -subdirectories = TargetInfo - -[component_0] -type = TargetGroup -name = CBackend -parent = Target - -[component_1] -type = Library -name = CBackendCodeGen -parent = CBackend -required_libraries = Analysis CBackendInfo CodeGen Core MC ScalarOpts Support Target TransformUtils -add_to_library_groups = CBackend diff --git a/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp b/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp index d6b1f427..76b3ceb2 100644 --- a/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp +++ b/lib/Target/CBackend/TargetInfo/CBackendTargetInfo.cpp @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/lib/Target/CBackend/TargetInfo/LLVMBuild.txt b/lib/Target/CBackend/TargetInfo/LLVMBuild.txt deleted file mode 100644 index 336207f4..00000000 --- a/lib/Target/CBackend/TargetInfo/LLVMBuild.txt +++ /dev/null @@ -1,23 +0,0 @@ -;===- ./lib/Target/CBackend/TargetInfo/LLVMBuild.txt -----------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[component_0] -type = Library -name = CBackendInfo -parent = CBackend -required_libraries = MC ScalarOpts Support Target -add_to_library_groups = CBackend diff --git a/lib/Target/CBackend/TopologicalSorter.cpp b/lib/Target/CBackend/TopologicalSorter.cpp index 4558445c..89084d5f 100644 --- a/lib/Target/CBackend/TopologicalSorter.cpp +++ b/lib/Target/CBackend/TopologicalSorter.cpp @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/lib/Target/CBackend/TopologicalSorter.h b/lib/Target/CBackend/TopologicalSorter.h index 6a1563db..3bd0099a 100644 --- a/lib/Target/CBackend/TopologicalSorter.h +++ b/lib/Target/CBackend/TopologicalSorter.h @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/runtime/windows/atomics.c b/runtime/windows/atomics.c index 1d26f366..10599b92 100644 --- a/runtime/windows/atomics.c +++ b/runtime/windows/atomics.c @@ -1,3 +1,13 @@ +//===------------------ atomics.c------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + #include #include #include diff --git a/test/c_tests/compound_types/test_array_of_structs.c b/test/c_tests/compound_types/test_array_of_structs.c index 3275cdf0..dba737ab 100644 --- a/test/c_tests/compound_types/test_array_of_structs.c +++ b/test/c_tests/compound_types/test_array_of_structs.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_get_array_element.c b/test/c_tests/compound_types/test_get_array_element.c index d5b33841..46dc000d 100644 --- a/test/c_tests/compound_types/test_get_array_element.c +++ b/test/c_tests/compound_types/test_get_array_element.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_get_struct_member.c b/test/c_tests/compound_types/test_get_struct_member.c index 0b2c9a76..90faa719 100644 --- a/test/c_tests/compound_types/test_get_struct_member.c +++ b/test/c_tests/compound_types/test_get_struct_member.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_get_union_member.c b/test/c_tests/compound_types/test_get_union_member.c index dc9f60ab..dfee0aab 100644 --- a/test/c_tests/compound_types/test_get_union_member.c +++ b/test/c_tests/compound_types/test_get_union_member.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_nested_struct.c b/test/c_tests/compound_types/test_nested_struct.c index 2233aaf8..b0c0079f 100644 --- a/test/c_tests/compound_types/test_nested_struct.c +++ b/test/c_tests/compound_types/test_nested_struct.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_self_ref_struct.c b/test/c_tests/compound_types/test_self_ref_struct.c index 0c1d7789..2711d59d 100644 --- a/test/c_tests/compound_types/test_self_ref_struct.c +++ b/test/c_tests/compound_types/test_self_ref_struct.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_sizeof_packed_struct.c b/test/c_tests/compound_types/test_sizeof_packed_struct.c index df8c8b53..2768c9d3 100644 --- a/test/c_tests/compound_types/test_sizeof_packed_struct.c +++ b/test/c_tests/compound_types/test_sizeof_packed_struct.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_sizeof_union.c b/test/c_tests/compound_types/test_sizeof_union.c index b718f8fc..b88f135c 100644 --- a/test/c_tests/compound_types/test_sizeof_union.c +++ b/test/c_tests/compound_types/test_sizeof_union.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_two_dim_array.c b/test/c_tests/compound_types/test_two_dim_array.c index 71709f5d..62622613 100644 --- a/test/c_tests/compound_types/test_two_dim_array.c +++ b/test/c_tests/compound_types/test_two_dim_array.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_two_dim_array_pointer.c b/test/c_tests/compound_types/test_two_dim_array_pointer.c index b605dffd..e76f63e7 100644 --- a/test/c_tests/compound_types/test_two_dim_array_pointer.c +++ b/test/c_tests/compound_types/test_two_dim_array_pointer.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_typedef_struct.c b/test/c_tests/compound_types/test_typedef_struct.c index 7b319b4d..6cbb4235 100644 --- a/test/c_tests/compound_types/test_typedef_struct.c +++ b/test/c_tests/compound_types/test_typedef_struct.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/compound_types/test_zero_length_array.c b/test/c_tests/compound_types/test_zero_length_array.c index cba4516d..0a53ecbc 100644 --- a/test/c_tests/compound_types/test_zero_length_array.c +++ b/test/c_tests/compound_types/test_zero_length_array.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_char.c b/test/c_tests/declarations/test_declare_char.c index c22725f8..f9fa96ff 100644 --- a/test/c_tests/declarations/test_declare_char.c +++ b/test/c_tests/declarations/test_declare_char.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_double.c b/test/c_tests/declarations/test_declare_double.c index df1ce458..24edc52c 100644 --- a/test/c_tests/declarations/test_declare_double.c +++ b/test/c_tests/declarations/test_declare_double.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_float.c b/test/c_tests/declarations/test_declare_float.c index 6636c463..0a83a107 100644 --- a/test/c_tests/declarations/test_declare_float.c +++ b/test/c_tests/declarations/test_declare_float.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_int.c b/test/c_tests/declarations/test_declare_int.c index 5a4fd3d7..e4cccf2b 100644 --- a/test/c_tests/declarations/test_declare_int.c +++ b/test/c_tests/declarations/test_declare_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_long.c b/test/c_tests/declarations/test_declare_long.c index 5673fe0e..0abd72af 100644 --- a/test/c_tests/declarations/test_declare_long.c +++ b/test/c_tests/declarations/test_declare_long.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_long_double.c b/test/c_tests/declarations/test_declare_long_double.c index 376157e8..9b147128 100644 --- a/test/c_tests/declarations/test_declare_long_double.c +++ b/test/c_tests/declarations/test_declare_long_double.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_long_int.c b/test/c_tests/declarations/test_declare_long_int.c index 83a701f5..9786457f 100644 --- a/test/c_tests/declarations/test_declare_long_int.c +++ b/test/c_tests/declarations/test_declare_long_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_long_long.c b/test/c_tests/declarations/test_declare_long_long.c index fb96e6a7..42aaa5bf 100644 --- a/test/c_tests/declarations/test_declare_long_long.c +++ b/test/c_tests/declarations/test_declare_long_long.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_long_long_int.c b/test/c_tests/declarations/test_declare_long_long_int.c index 80d31873..d51d18fe 100644 --- a/test/c_tests/declarations/test_declare_long_long_int.c +++ b/test/c_tests/declarations/test_declare_long_long_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_short.c b/test/c_tests/declarations/test_declare_short.c index 5bbdee74..f6e75277 100644 --- a/test/c_tests/declarations/test_declare_short.c +++ b/test/c_tests/declarations/test_declare_short.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_short_int.c b/test/c_tests/declarations/test_declare_short_int.c index faa96e20..266771c9 100644 --- a/test/c_tests/declarations/test_declare_short_int.c +++ b/test/c_tests/declarations/test_declare_short_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_char.c b/test/c_tests/declarations/test_declare_signed_char.c index 59f36e4b..14a32be4 100644 --- a/test/c_tests/declarations/test_declare_signed_char.c +++ b/test/c_tests/declarations/test_declare_signed_char.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_int.c b/test/c_tests/declarations/test_declare_signed_int.c index de51b2aa..331a88dc 100644 --- a/test/c_tests/declarations/test_declare_signed_int.c +++ b/test/c_tests/declarations/test_declare_signed_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_long.c b/test/c_tests/declarations/test_declare_signed_long.c index 03e70492..4727bf5e 100644 --- a/test/c_tests/declarations/test_declare_signed_long.c +++ b/test/c_tests/declarations/test_declare_signed_long.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_long_int.c b/test/c_tests/declarations/test_declare_signed_long_int.c index 2dffbf5a..998c7852 100644 --- a/test/c_tests/declarations/test_declare_signed_long_int.c +++ b/test/c_tests/declarations/test_declare_signed_long_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_long_long.c b/test/c_tests/declarations/test_declare_signed_long_long.c index 8ae8b0e3..162d44e2 100644 --- a/test/c_tests/declarations/test_declare_signed_long_long.c +++ b/test/c_tests/declarations/test_declare_signed_long_long.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_long_long_int.c b/test/c_tests/declarations/test_declare_signed_long_long_int.c index 736ae2e0..70cb8c2c 100644 --- a/test/c_tests/declarations/test_declare_signed_long_long_int.c +++ b/test/c_tests/declarations/test_declare_signed_long_long_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_short.c b/test/c_tests/declarations/test_declare_signed_short.c index c3c93df9..9ba58c06 100644 --- a/test/c_tests/declarations/test_declare_signed_short.c +++ b/test/c_tests/declarations/test_declare_signed_short.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_signed_short_int.c b/test/c_tests/declarations/test_declare_signed_short_int.c index 07ed0489..6e4d82a3 100644 --- a/test/c_tests/declarations/test_declare_signed_short_int.c +++ b/test/c_tests/declarations/test_declare_signed_short_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_char.c b/test/c_tests/declarations/test_declare_unsigned_char.c index c313d4be..47ae7bdb 100644 --- a/test/c_tests/declarations/test_declare_unsigned_char.c +++ b/test/c_tests/declarations/test_declare_unsigned_char.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_int.c b/test/c_tests/declarations/test_declare_unsigned_int.c index c3a08c05..7710d950 100644 --- a/test/c_tests/declarations/test_declare_unsigned_int.c +++ b/test/c_tests/declarations/test_declare_unsigned_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_long.c b/test/c_tests/declarations/test_declare_unsigned_long.c index 15004604..fd4ea477 100644 --- a/test/c_tests/declarations/test_declare_unsigned_long.c +++ b/test/c_tests/declarations/test_declare_unsigned_long.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_long_int.c b/test/c_tests/declarations/test_declare_unsigned_long_int.c index 06038b43..5f1053fd 100644 --- a/test/c_tests/declarations/test_declare_unsigned_long_int.c +++ b/test/c_tests/declarations/test_declare_unsigned_long_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_long_long.c b/test/c_tests/declarations/test_declare_unsigned_long_long.c index de701a72..a248f16a 100644 --- a/test/c_tests/declarations/test_declare_unsigned_long_long.c +++ b/test/c_tests/declarations/test_declare_unsigned_long_long.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_long_long_int.c b/test/c_tests/declarations/test_declare_unsigned_long_long_int.c index dec24f10..43373401 100644 --- a/test/c_tests/declarations/test_declare_unsigned_long_long_int.c +++ b/test/c_tests/declarations/test_declare_unsigned_long_long_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_short.c b/test/c_tests/declarations/test_declare_unsigned_short.c index 368eb02f..45c0b050 100644 --- a/test/c_tests/declarations/test_declare_unsigned_short.c +++ b/test/c_tests/declarations/test_declare_unsigned_short.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_unsigned_short_int.c b/test/c_tests/declarations/test_declare_unsigned_short_int.c index dc87d1fa..2383c291 100644 --- a/test/c_tests/declarations/test_declare_unsigned_short_int.c +++ b/test/c_tests/declarations/test_declare_unsigned_short_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/declarations/test_declare_volatile_unsigned_int.c b/test/c_tests/declarations/test_declare_volatile_unsigned_int.c index 6a42a306..b96afcb2 100644 --- a/test/c_tests/declarations/test_declare_volatile_unsigned_int.c +++ b/test/c_tests/declarations/test_declare_volatile_unsigned_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_casted_nested_function_ptr_argument.c b/test/c_tests/functions/test_casted_nested_function_ptr_argument.c index 467e3022..a968372d 100644 --- a/test/c_tests/functions/test_casted_nested_function_ptr_argument.c +++ b/test/c_tests/functions/test_casted_nested_function_ptr_argument.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_fibonacci_function.c b/test/c_tests/functions/test_fibonacci_function.c index 88182d9b..68405cc9 100644 --- a/test/c_tests/functions/test_fibonacci_function.c +++ b/test/c_tests/functions/test_fibonacci_function.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_function_ptr.c b/test/c_tests/functions/test_function_ptr.c index 7a0c350e..96d58ccd 100644 --- a/test/c_tests/functions/test_function_ptr.c +++ b/test/c_tests/functions/test_function_ptr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_function_ptr_argument.c b/test/c_tests/functions/test_function_ptr_argument.c index ccc494dd..f7ba6b20 100644 --- a/test/c_tests/functions/test_function_ptr_argument.c +++ b/test/c_tests/functions/test_function_ptr_argument.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_head_recursion.c b/test/c_tests/functions/test_head_recursion.c index 4db6cd28..f5de65d2 100644 --- a/test/c_tests/functions/test_head_recursion.c +++ b/test/c_tests/functions/test_head_recursion.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_nested_function_ptr_argument.c b/test/c_tests/functions/test_nested_function_ptr_argument.c index e87ce9b6..21bd16ff 100644 --- a/test/c_tests/functions/test_nested_function_ptr_argument.c +++ b/test/c_tests/functions/test_nested_function_ptr_argument.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_recursive_function.c b/test/c_tests/functions/test_recursive_function.c index c85e545f..6a17a438 100644 --- a/test/c_tests/functions/test_recursive_function.c +++ b/test/c_tests/functions/test_recursive_function.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_simple_function.c b/test/c_tests/functions/test_simple_function.c index 9353b397..13a8552b 100644 --- a/test/c_tests/functions/test_simple_function.c +++ b/test/c_tests/functions/test_simple_function.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_static_function.c b/test/c_tests/functions/test_static_function.c index 3c9fe0c7..03c4ef95 100644 --- a/test/c_tests/functions/test_static_function.c +++ b/test/c_tests/functions/test_static_function.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_struct_function_argument.c b/test/c_tests/functions/test_struct_function_argument.c index 5079ba35..49f67770 100644 --- a/test/c_tests/functions/test_struct_function_argument.c +++ b/test/c_tests/functions/test_struct_function_argument.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_tail_recursion.c b/test/c_tests/functions/test_tail_recursion.c index 913ba76d..ac205e2d 100644 --- a/test/c_tests/functions/test_tail_recursion.c +++ b/test/c_tests/functions/test_tail_recursion.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/functions/test_zero_length_array_argument.c b/test/c_tests/functions/test_zero_length_array_argument.c index 4773be98..d4797afa 100644 --- a/test/c_tests/functions/test_zero_length_array_argument.c +++ b/test/c_tests/functions/test_zero_length_array_argument.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_add_int_vars.c b/test/c_tests/operators/test_add_int_vars.c index 39c72f17..58a69fde 100644 --- a/test/c_tests/operators/test_add_int_vars.c +++ b/test/c_tests/operators/test_add_int_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_bitwise_and.c b/test/c_tests/operators/test_bitwise_and.c index 0e2efa19..de61e441 100644 --- a/test/c_tests/operators/test_bitwise_and.c +++ b/test/c_tests/operators/test_bitwise_and.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_bitwise_not.c b/test/c_tests/operators/test_bitwise_not.c index 4a01d256..bfaee106 100644 --- a/test/c_tests/operators/test_bitwise_not.c +++ b/test/c_tests/operators/test_bitwise_not.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_bitwise_or.c b/test/c_tests/operators/test_bitwise_or.c index 736a2b29..be6a39db 100644 --- a/test/c_tests/operators/test_bitwise_or.c +++ b/test/c_tests/operators/test_bitwise_or.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_bitwise_shl.c b/test/c_tests/operators/test_bitwise_shl.c index b2b769fe..5c519468 100644 --- a/test/c_tests/operators/test_bitwise_shl.c +++ b/test/c_tests/operators/test_bitwise_shl.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_bitwise_shr.c b/test/c_tests/operators/test_bitwise_shr.c index bd206886..f3ee430c 100644 --- a/test/c_tests/operators/test_bitwise_shr.c +++ b/test/c_tests/operators/test_bitwise_shr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_bitwise_xor.c b/test/c_tests/operators/test_bitwise_xor.c index b310315c..62a13ea5 100644 --- a/test/c_tests/operators/test_bitwise_xor.c +++ b/test/c_tests/operators/test_bitwise_xor.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_add_assign.c b/test/c_tests/operators/test_compound_add_assign.c index fb9a8f31..a0c81830 100644 --- a/test/c_tests/operators/test_compound_add_assign.c +++ b/test/c_tests/operators/test_compound_add_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_bitwise_and_assign.c b/test/c_tests/operators/test_compound_bitwise_and_assign.c index c31cf3de..db6ace39 100644 --- a/test/c_tests/operators/test_compound_bitwise_and_assign.c +++ b/test/c_tests/operators/test_compound_bitwise_and_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_bitwise_or_assign.c b/test/c_tests/operators/test_compound_bitwise_or_assign.c index 3189a001..30dd8595 100644 --- a/test/c_tests/operators/test_compound_bitwise_or_assign.c +++ b/test/c_tests/operators/test_compound_bitwise_or_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_bitwise_xor_assign.c b/test/c_tests/operators/test_compound_bitwise_xor_assign.c index 5bfd50f6..09a650ad 100644 --- a/test/c_tests/operators/test_compound_bitwise_xor_assign.c +++ b/test/c_tests/operators/test_compound_bitwise_xor_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_divide_assign.c b/test/c_tests/operators/test_compound_divide_assign.c index fadc85f0..8863a661 100644 --- a/test/c_tests/operators/test_compound_divide_assign.c +++ b/test/c_tests/operators/test_compound_divide_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_modulus_assign.c b/test/c_tests/operators/test_compound_modulus_assign.c index c6a0f222..cf0765f6 100644 --- a/test/c_tests/operators/test_compound_modulus_assign.c +++ b/test/c_tests/operators/test_compound_modulus_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_multiply_assign.c b/test/c_tests/operators/test_compound_multiply_assign.c index 85ef93b1..43893b4a 100644 --- a/test/c_tests/operators/test_compound_multiply_assign.c +++ b/test/c_tests/operators/test_compound_multiply_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_shl_assign.c b/test/c_tests/operators/test_compound_shl_assign.c index fdbcfac8..66281f52 100644 --- a/test/c_tests/operators/test_compound_shl_assign.c +++ b/test/c_tests/operators/test_compound_shl_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_shr_assign.c b/test/c_tests/operators/test_compound_shr_assign.c index f8151893..20489842 100644 --- a/test/c_tests/operators/test_compound_shr_assign.c +++ b/test/c_tests/operators/test_compound_shr_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_compound_subtract_assign.c b/test/c_tests/operators/test_compound_subtract_assign.c index ddebe2a3..20c97680 100644 --- a/test/c_tests/operators/test_compound_subtract_assign.c +++ b/test/c_tests/operators/test_compound_subtract_assign.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_divide_int_vars.c b/test/c_tests/operators/test_divide_int_vars.c index 87146ca7..165c5d74 100644 --- a/test/c_tests/operators/test_divide_int_vars.c +++ b/test/c_tests/operators/test_divide_int_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_equal_operator.c b/test/c_tests/operators/test_equal_operator.c index c4238923..6a67df88 100644 --- a/test/c_tests/operators/test_equal_operator.c +++ b/test/c_tests/operators/test_equal_operator.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_greater_than.c b/test/c_tests/operators/test_greater_than.c index 20561e2f..4f354746 100644 --- a/test/c_tests/operators/test_greater_than.c +++ b/test/c_tests/operators/test_greater_than.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_greater_than_or_equal.c b/test/c_tests/operators/test_greater_than_or_equal.c index 25a93adf..b80a178c 100644 --- a/test/c_tests/operators/test_greater_than_or_equal.c +++ b/test/c_tests/operators/test_greater_than_or_equal.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_less_than.c b/test/c_tests/operators/test_less_than.c index 8c26a045..f622096a 100644 --- a/test/c_tests/operators/test_less_than.c +++ b/test/c_tests/operators/test_less_than.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_less_than_or_equal.c b/test/c_tests/operators/test_less_than_or_equal.c index 0777c412..b21849bf 100644 --- a/test/c_tests/operators/test_less_than_or_equal.c +++ b/test/c_tests/operators/test_less_than_or_equal.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_logical_and.c b/test/c_tests/operators/test_logical_and.c index 8a41ff57..e0cc14d5 100644 --- a/test/c_tests/operators/test_logical_and.c +++ b/test/c_tests/operators/test_logical_and.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_logical_or.c b/test/c_tests/operators/test_logical_or.c index 66aac084..da6ff6ee 100644 --- a/test/c_tests/operators/test_logical_or.c +++ b/test/c_tests/operators/test_logical_or.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_modulus_int_vars.c b/test/c_tests/operators/test_modulus_int_vars.c index afea40b5..b17d5f94 100644 --- a/test/c_tests/operators/test_modulus_int_vars.c +++ b/test/c_tests/operators/test_modulus_int_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_multiply_int_vars.c b/test/c_tests/operators/test_multiply_int_vars.c index e7981950..bc5bcbc4 100644 --- a/test/c_tests/operators/test_multiply_int_vars.c +++ b/test/c_tests/operators/test_multiply_int_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_not_equal_operator.c b/test/c_tests/operators/test_not_equal_operator.c index dacf3c73..60e77fe1 100644 --- a/test/c_tests/operators/test_not_equal_operator.c +++ b/test/c_tests/operators/test_not_equal_operator.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_postincrement.c b/test/c_tests/operators/test_postincrement.c index 378d30fe..a8b53191 100644 --- a/test/c_tests/operators/test_postincrement.c +++ b/test/c_tests/operators/test_postincrement.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_preincrement.c b/test/c_tests/operators/test_preincrement.c index f3bd76d9..15e90ac7 100644 --- a/test/c_tests/operators/test_preincrement.c +++ b/test/c_tests/operators/test_preincrement.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_subtract_int_vars.c b/test/c_tests/operators/test_subtract_int_vars.c index 26703145..ce6afd12 100644 --- a/test/c_tests/operators/test_subtract_int_vars.c +++ b/test/c_tests/operators/test_subtract_int_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_unary_minus_int.c b/test/c_tests/operators/test_unary_minus_int.c index b8a22193..4497c1e1 100644 --- a/test/c_tests/operators/test_unary_minus_int.c +++ b/test/c_tests/operators/test_unary_minus_int.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/operators/test_unary_plus_char.c b/test/c_tests/operators/test_unary_plus_char.c index d6bbdf52..d5602cca 100644 --- a/test/c_tests/operators/test_unary_plus_char.c +++ b/test/c_tests/operators/test_unary_plus_char.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_macro_substitution.c b/test/c_tests/other/test_macro_substitution.c index 7693e18c..d6e5a9e6 100644 --- a/test/c_tests/other/test_macro_substitution.c +++ b/test/c_tests/other/test_macro_substitution.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_mutual_ref_globals.c b/test/c_tests/other/test_mutual_ref_globals.c index 64830b32..2e6af5bb 100644 --- a/test/c_tests/other/test_mutual_ref_globals.c +++ b/test/c_tests/other/test_mutual_ref_globals.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_null_is_0.c b/test/c_tests/other/test_null_is_0.c index 56b20f20..6bfd8908 100644 --- a/test/c_tests/other/test_null_is_0.c +++ b/test/c_tests/other/test_null_is_0.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_register_vars.c b/test/c_tests/other/test_register_vars.c index a42041c4..a4f93ce3 100644 --- a/test/c_tests/other/test_register_vars.c +++ b/test/c_tests/other/test_register_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_return_success.c b/test/c_tests/other/test_return_success.c index 616cc843..82475583 100644 --- a/test/c_tests/other/test_return_success.c +++ b/test/c_tests/other/test_return_success.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_static_vars.c b/test/c_tests/other/test_static_vars.c index 48233e3f..9f40c74c 100644 --- a/test/c_tests/other/test_static_vars.c +++ b/test/c_tests/other/test_static_vars.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/other/test_test_failure.c b/test/c_tests/other/test_test_failure.c index 3187381c..e5433137 100644 --- a/test/c_tests/other/test_test_failure.c +++ b/test/c_tests/other/test_test_failure.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_address_of_operator.c b/test/c_tests/pointers/test_address_of_operator.c index bcff78ca..65f22f7e 100644 --- a/test/c_tests/pointers/test_address_of_operator.c +++ b/test/c_tests/pointers/test_address_of_operator.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_char_sized_ptr_math_decr.c b/test/c_tests/pointers/test_char_sized_ptr_math_decr.c index 45ccc902..ed10d2bd 100644 --- a/test/c_tests/pointers/test_char_sized_ptr_math_decr.c +++ b/test/c_tests/pointers/test_char_sized_ptr_math_decr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_char_sized_ptr_math_incr.c b/test/c_tests/pointers/test_char_sized_ptr_math_incr.c index 5072bfe6..e39e5b20 100644 --- a/test/c_tests/pointers/test_char_sized_ptr_math_incr.c +++ b/test/c_tests/pointers/test_char_sized_ptr_math_incr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_deref_array_item.c b/test/c_tests/pointers/test_deref_array_item.c index 1a79658f..9c9ecf08 100644 --- a/test/c_tests/pointers/test_deref_array_item.c +++ b/test/c_tests/pointers/test_deref_array_item.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_deref_char_ptr.c b/test/c_tests/pointers/test_deref_char_ptr.c index d0bd3de0..13fba2dd 100644 --- a/test/c_tests/pointers/test_deref_char_ptr.c +++ b/test/c_tests/pointers/test_deref_char_ptr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_deref_double_ptr.c b/test/c_tests/pointers/test_deref_double_ptr.c index 48e08e81..1364cb1b 100644 --- a/test/c_tests/pointers/test_deref_double_ptr.c +++ b/test/c_tests/pointers/test_deref_double_ptr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_deref_float_ptr.c b/test/c_tests/pointers/test_deref_float_ptr.c index d1066e2f..08722140 100644 --- a/test/c_tests/pointers/test_deref_float_ptr.c +++ b/test/c_tests/pointers/test_deref_float_ptr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_deref_int_ptr.c b/test/c_tests/pointers/test_deref_int_ptr.c index 0e0b9d8d..48a449df 100644 --- a/test/c_tests/pointers/test_deref_int_ptr.c +++ b/test/c_tests/pointers/test_deref_int_ptr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_deref_struct_ptr.c b/test/c_tests/pointers/test_deref_struct_ptr.c index a7ef2986..288923eb 100644 --- a/test/c_tests/pointers/test_deref_struct_ptr.c +++ b/test/c_tests/pointers/test_deref_struct_ptr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_int_sized_ptr_math_decr.c b/test/c_tests/pointers/test_int_sized_ptr_math_decr.c index c8342fc9..0e72c5a1 100644 --- a/test/c_tests/pointers/test_int_sized_ptr_math_decr.c +++ b/test/c_tests/pointers/test_int_sized_ptr_math_decr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/pointers/test_int_sized_ptr_math_incr.c b/test/c_tests/pointers/test_int_sized_ptr_math_incr.c index 86a991cf..6071ec44 100644 --- a/test/c_tests/pointers/test_int_sized_ptr_math_incr.c +++ b/test/c_tests/pointers/test_int_sized_ptr_math_incr.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_break_stmt.c b/test/c_tests/statements/test_break_stmt.c index e69a1dc7..6da74235 100644 --- a/test/c_tests/statements/test_break_stmt.c +++ b/test/c_tests/statements/test_break_stmt.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_goto_stmt.c b/test/c_tests/statements/test_goto_stmt.c index c8be504f..0e4b4859 100644 --- a/test/c_tests/statements/test_goto_stmt.c +++ b/test/c_tests/statements/test_goto_stmt.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_nested_for_loop.c b/test/c_tests/statements/test_nested_for_loop.c index 1f9651ae..e7eb4225 100644 --- a/test/c_tests/statements/test_nested_for_loop.c +++ b/test/c_tests/statements/test_nested_for_loop.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_nested_switch_stmt.c b/test/c_tests/statements/test_nested_switch_stmt.c index 8b1754ed..f60c0581 100644 --- a/test/c_tests/statements/test_nested_switch_stmt.c +++ b/test/c_tests/statements/test_nested_switch_stmt.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_nested_while_loop.c b/test/c_tests/statements/test_nested_while_loop.c index 2981aa0d..e28683d9 100644 --- a/test/c_tests/statements/test_nested_while_loop.c +++ b/test/c_tests/statements/test_nested_while_loop.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_do_while.c b/test/c_tests/statements/test_simple_do_while.c index 7c0de66b..3d1c14a9 100644 --- a/test/c_tests/statements/test_simple_do_while.c +++ b/test/c_tests/statements/test_simple_do_while.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_for_loop.c b/test/c_tests/statements/test_simple_for_loop.c index ecd9dc86..0efde5ea 100644 --- a/test/c_tests/statements/test_simple_for_loop.c +++ b/test/c_tests/statements/test_simple_for_loop.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_if_else.c b/test/c_tests/statements/test_simple_if_else.c index ec07e9ad..24095d49 100644 --- a/test/c_tests/statements/test_simple_if_else.c +++ b/test/c_tests/statements/test_simple_if_else.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_if_else_use_else.c b/test/c_tests/statements/test_simple_if_else_use_else.c index e835bef3..60633b6e 100644 --- a/test/c_tests/statements/test_simple_if_else_use_else.c +++ b/test/c_tests/statements/test_simple_if_else_use_else.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_if_stmt.c b/test/c_tests/statements/test_simple_if_stmt.c index 89d8f15f..15f16139 100644 --- a/test/c_tests/statements/test_simple_if_stmt.c +++ b/test/c_tests/statements/test_simple_if_stmt.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_switch_stmt.c b/test/c_tests/statements/test_simple_switch_stmt.c index 13d0788e..ec8263ad 100644 --- a/test/c_tests/statements/test_simple_switch_stmt.c +++ b/test/c_tests/statements/test_simple_switch_stmt.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/statements/test_simple_while_loop.c b/test/c_tests/statements/test_simple_while_loop.c index 92ca65f2..0e34bb68 100644 --- a/test/c_tests/statements/test_simple_while_loop.c +++ b/test/c_tests/statements/test_simple_while_loop.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/test/c_tests/stdatomic/test_atomic_fence.c b/test/c_tests/stdatomic/test_atomic_fence.c index c43c8b1e..191c875e 100644 --- a/test/c_tests/stdatomic/test_atomic_fence.c +++ b/test/c_tests/stdatomic/test_atomic_fence.c @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // diff --git a/tools/llvm-cbe/LLVMBuild.txt b/tools/llvm-cbe/LLVMBuild.txt deleted file mode 100644 index 675e1d5b..00000000 --- a/tools/llvm-cbe/LLVMBuild.txt +++ /dev/null @@ -1,37 +0,0 @@ -;===- ./tools/llc/LLVMBuild.txt --------------------------------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[component_0] -type = Tool -name = llc -parent = Tools -required_libraries = - Analysis - AsmParser - AsmPrinter - BitReader - CBackendCodeGen - CBackendInfo - CodeGen - Core - IRReader - MC - ScalarOpts - SelectionDAG - Support - Target - all-targets diff --git a/tools/llvm-cbe/llvm-cbe.cpp b/tools/llvm-cbe/llvm-cbe.cpp index 9aef0c65..a7dd7832 100644 --- a/tools/llvm-cbe/llvm-cbe.cpp +++ b/tools/llvm-cbe/llvm-cbe.cpp @@ -2,8 +2,9 @@ // // The LLVM Compiler Infrastructure // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT for details. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // From f072e9d1e8c4a9f100b99a973ac3c4ff2b0a88bf Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 19 Jul 2023 14:30:40 -0700 Subject: [PATCH 2/3] Fix formatting --- lib/Target/CBackend/CBackend.h | 598 +++++++++++++++++---------------- 1 file changed, 300 insertions(+), 298 deletions(-) diff --git a/lib/Target/CBackend/CBackend.h b/lib/Target/CBackend/CBackend.h index ca405e57..2c388943 100644 --- a/lib/Target/CBackend/CBackend.h +++ b/lib/Target/CBackend/CBackend.h @@ -53,311 +53,313 @@ namespace llvm_cbe { -using namespace llvm; - -class CBEMCAsmInfo : public MCAsmInfo { -public: - CBEMCAsmInfo() { PrivateGlobalPrefix = ""; } -}; - -/// CWriter - This class is the main chunk of code that converts an LLVM -/// module to a C translation unit. -class CWriter : public FunctionPass, public InstVisitor { - std::string _Out; - std::string _OutHeaders; - raw_string_ostream OutHeaders; - raw_string_ostream Out; - raw_ostream &FileOut; - IntrinsicLowering *IL = nullptr; - LoopInfo *LI = nullptr; - const Module *TheModule = nullptr; - const MCAsmInfo *TAsm = nullptr; - const MCRegisterInfo *MRI = nullptr; - const MCObjectFileInfo *MOFI = nullptr; - MCContext *TCtx = nullptr; - const DataLayout *TD = nullptr; - const Instruction *CurInstr = nullptr; - - IDMap FPConstantMap; - - IDMap AnonValueNumbers; - - /// UnnamedStructIDs - This contains a unique ID for each struct that is - /// either anonymous or has no name. - IDMap UnnamedStructIDs; - - std::set TypedefDeclTypes; - std::set SelectDeclTypes; - std::set> CmpDeclTypes; - std::set>> - CastOpDeclTypes; - std::set> InlineOpDeclTypes; - std::set CtorDeclTypes; - - IDMap>> - UnnamedFunctionIDs; - - // This is used to keep track of intrinsics that get generated to a lowered - // function. We must generate the prototypes before the function body which - // will only be expanded on first use - std::vector prototypesToGen; - - unsigned LastAnnotatedSourceLine = 0; - - struct { - // Standard headers - bool Stdarg : 1; - bool Setjmp : 1; - bool Limits : 1; - bool Math : 1; + using namespace llvm; - // printModuleTypes() - bool BitCastUnion : 1; + class CBEMCAsmInfo : public MCAsmInfo { + public: + CBEMCAsmInfo() { PrivateGlobalPrefix = ""; } + }; - // generateCompilerSpecificCode() - bool BuiltinAlloca : 1; - bool Unreachable : 1; - bool NoReturn : 1; - bool ExternalWeak : 1; - bool AttributeWeak : 1; - bool Hidden : 1; - bool AttributeList : 1; - bool UnalignedLoad : 1; - bool Aligns : 1; - bool NanInf : 1; - bool Int128 : 1; - bool ThreadFence : 1; - bool StackSaveRestore : 1; - bool ConstantDoubleTy : 1; - bool ConstantFloatTy : 1; - bool ConstantFP80Ty : 1; - bool ConstantFP128Ty : 1; - bool ForceInline : 1; - } UsedHeaders; + /// CWriter - This class is the main chunk of code that converts an LLVM + /// module to a C translation unit. + class CWriter : public FunctionPass, public InstVisitor { + std::string _Out; + std::string _OutHeaders; + raw_string_ostream OutHeaders; + raw_string_ostream Out; + raw_ostream &FileOut; + IntrinsicLowering *IL = nullptr; + LoopInfo *LI = nullptr; + const Module *TheModule = nullptr; + const MCAsmInfo *TAsm = nullptr; + const MCRegisterInfo *MRI = nullptr; + const MCObjectFileInfo *MOFI = nullptr; + MCContext *TCtx = nullptr; + const DataLayout *TD = nullptr; + const Instruction *CurInstr = nullptr; + + IDMap FPConstantMap; + + IDMap AnonValueNumbers; + + /// UnnamedStructIDs - This contains a unique ID for each struct that is + /// either anonymous or has no name. + IDMap UnnamedStructIDs; + + std::set TypedefDeclTypes; + std::set SelectDeclTypes; + std::set> CmpDeclTypes; + std::set>> + CastOpDeclTypes; + std::set> InlineOpDeclTypes; + std::set CtorDeclTypes; + + IDMap>> + UnnamedFunctionIDs; + + // This is used to keep track of intrinsics that get generated to a lowered + // function. We must generate the prototypes before the function body which + // will only be expanded on first use + std::vector prototypesToGen; + + unsigned LastAnnotatedSourceLine = 0; + + struct { + // Standard headers + bool Stdarg : 1; + bool Setjmp : 1; + bool Limits : 1; + bool Math : 1; + + // printModuleTypes() + bool BitCastUnion : 1; + + // generateCompilerSpecificCode() + bool BuiltinAlloca : 1; + bool Unreachable : 1; + bool NoReturn : 1; + bool ExternalWeak : 1; + bool AttributeWeak : 1; + bool Hidden : 1; + bool AttributeList : 1; + bool UnalignedLoad : 1; + bool Aligns : 1; + bool NanInf : 1; + bool Int128 : 1; + bool ThreadFence : 1; + bool StackSaveRestore : 1; + bool ConstantDoubleTy : 1; + bool ConstantFloatTy : 1; + bool ConstantFP80Ty : 1; + bool ConstantFP128Ty : 1; + bool ForceInline : 1; + } UsedHeaders; #define USED_HEADERS_FLAG(Name) \ void headerUse##Name() { UsedHeaders.Name = true; } \ bool headerInc##Name() const { return UsedHeaders.Name; } - // Standard headers - USED_HEADERS_FLAG(Stdarg) - USED_HEADERS_FLAG(Setjmp) - USED_HEADERS_FLAG(Limits) - USED_HEADERS_FLAG(Math) - - // printModuleTypes() - USED_HEADERS_FLAG(BitCastUnion) - - // generateCompilerSpecificCode() - USED_HEADERS_FLAG(BuiltinAlloca) - USED_HEADERS_FLAG(Unreachable) - USED_HEADERS_FLAG(NoReturn) - USED_HEADERS_FLAG(ExternalWeak) - USED_HEADERS_FLAG(AttributeWeak) - USED_HEADERS_FLAG(Hidden) - USED_HEADERS_FLAG(AttributeList) - USED_HEADERS_FLAG(UnalignedLoad) - USED_HEADERS_FLAG(Aligns) - USED_HEADERS_FLAG(NanInf) - USED_HEADERS_FLAG(Int128) - USED_HEADERS_FLAG(ThreadFence) - USED_HEADERS_FLAG(StackSaveRestore) - USED_HEADERS_FLAG(ConstantDoubleTy) - USED_HEADERS_FLAG(ConstantFloatTy) - USED_HEADERS_FLAG(ConstantFP80Ty) - USED_HEADERS_FLAG(ConstantFP128Ty) - USED_HEADERS_FLAG(ForceInline) - - llvm::SmallSet FCmpOps; - void headerUseFCmpOp(CmpInst::Predicate P); - - void generateCompilerSpecificCode(raw_ostream &Out, const DataLayout *) const; - -public: - static char ID; - explicit CWriter(raw_ostream &o) - : FunctionPass(ID), OutHeaders(_OutHeaders), Out(_Out), FileOut(o) { - memset(&UsedHeaders, 0, sizeof(UsedHeaders)); - } - - virtual StringRef getPassName() const { return "C backend"; } - - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - AU.setPreservesCFG(); - } - - virtual bool doInitialization(Module &M); - virtual bool doFinalization(Module &M); - virtual bool runOnFunction(Function &F); - -private: - void generateHeader(Module &M); - void declareOneGlobalVariable(GlobalVariable *I); - - void forwardDeclareStructs(raw_ostream &Out, Type *Ty, - std::set &TypesPrinted); - - raw_ostream &printFunctionAttributes(raw_ostream &Out, AttributeList Attrs); - - bool isStandardMain(const FunctionType *FTy); - raw_ostream & - printFunctionProto(raw_ostream &Out, FunctionType *Ty, - std::pair Attrs, - const std::string &Name, - iterator_range *ArgList); - raw_ostream &printFunctionProto(raw_ostream &Out, Function *F) { - return printFunctionProto( - Out, F->getFunctionType(), - std::make_pair(F->getAttributes(), F->getCallingConv()), - GetValueName(F), nullptr); - } - - raw_ostream & - printFunctionDeclaration(raw_ostream &Out, FunctionType *Ty, - std::pair PAL = - std::make_pair(AttributeList(), CallingConv::C)); - raw_ostream &printStructDeclaration(raw_ostream &Out, StructType *Ty); - raw_ostream &printArrayDeclaration(raw_ostream &Out, ArrayType *Ty); - raw_ostream &printVectorDeclaration(raw_ostream &Out, VectorType *Ty); - - raw_ostream &printTypeName(raw_ostream &Out, Type *Ty, bool isSigned = false, - std::pair PAL = - std::make_pair(AttributeList(), - CallingConv::C)); - raw_ostream &printTypeNameForAddressableValue(raw_ostream &Out, Type *Ty, - bool isSigned = false); - raw_ostream &printSimpleType(raw_ostream &Out, Type *Ty, bool isSigned); - raw_ostream &printTypeString(raw_ostream &Out, Type *Ty, bool isSigned); - - std::string getStructName(StructType *ST); - std::string getFunctionName(FunctionType *FT, - std::pair PAL = - std::make_pair(AttributeList(), - CallingConv::C)); - std::string getArrayName(ArrayType *AT); - std::string getVectorName(VectorType *VT); - - enum OperandContext { - ContextNormal, - ContextCasted, - // Casted context means the type-cast will be implicit, - // such as the RHS of a `var = RHS;` expression - // or inside a struct initializer expression - ContextStatic - // Static context means that it is being used in as a static initializer - // (also implies ContextCasted) - }; + // Standard headers + USED_HEADERS_FLAG(Stdarg) + USED_HEADERS_FLAG(Setjmp) + USED_HEADERS_FLAG(Limits) + USED_HEADERS_FLAG(Math) + + // printModuleTypes() + USED_HEADERS_FLAG(BitCastUnion) - void writeOperandDeref(Value *Operand); - void writeOperand(Value *Operand, - enum OperandContext Context = ContextNormal); - void writeInstComputationInline(Instruction &I); - void writeOperandInternal(Value *Operand, - enum OperandContext Context = ContextNormal); - void writeOperandWithCast(Value *Operand, unsigned Opcode); - void opcodeNeedsCast(unsigned Opcode, bool &shouldCast, bool &castIsSigned); - - void writeOperandWithCast(Value *Operand, ICmpInst &I); - bool writeInstructionCast(Instruction &I); - void writeMemoryAccess(Value *Operand, Type *OperandType, bool IsVolatile, - unsigned Alignment); - - std::string InterpretASMConstraint(InlineAsm::ConstraintInfo &c); - - bool lowerIntrinsics(Function &F); - /// Prints the definition of the intrinsic function F. Supports the - /// intrinsics which need to be explicitly defined in the CBackend. - void printIntrinsicDefinition(Function &F, raw_ostream &Out); - void printIntrinsicDefinition(FunctionType *funT, unsigned Opcode, - std::string OpName, raw_ostream &Out); - - void printModuleTypes(raw_ostream &Out); - void printContainedTypes(raw_ostream &Out, Type *Ty, std::set &); - - void printFloatingPointConstants(Function &F); - void printFloatingPointConstants(const Constant *C); - - void printFunction(Function &); - void printBasicBlock(BasicBlock *BB); - void printLoop(Loop *L); - - void printCast(unsigned opcode, Type *SrcTy, Type *DstTy); - void printConstant(Constant *CPV, enum OperandContext Context); - void printConstantWithCast(Constant *CPV, unsigned Opcode); - bool printConstExprCast(ConstantExpr *CE); - void printConstantArray(ConstantArray *CPA, enum OperandContext Context); - void printConstantVector(ConstantVector *CV, enum OperandContext Context); - void printConstantDataSequential(ConstantDataSequential *CDS, - enum OperandContext Context); - bool printConstantString(Constant *C, enum OperandContext Context); - - bool isEmptyType(Type *Ty) const; - Type *skipEmptyArrayTypes(Type *Ty) const; - bool isAddressExposed(Value *V) const; - bool isInlinableInst(Instruction &I) const; - AllocaInst *isDirectAlloca(Value *V) const; - bool isInlineAsm(Instruction &I) const; - - // Instruction visitation functions - friend class InstVisitor; - - void visitReturnInst(ReturnInst &I); - void visitBranchInst(BranchInst &I); - void visitSwitchInst(SwitchInst &I); - void visitIndirectBrInst(IndirectBrInst &I); - void visitInvokeInst(InvokeInst &I) { - llvm_unreachable("Lowerinvoke pass didn't work!"); - } - void visitResumeInst(ResumeInst &I) { - llvm_unreachable("DwarfEHPrepare pass didn't work!"); - } - void visitUnreachableInst(UnreachableInst &I); - - void visitPHINode(PHINode &I); - void visitUnaryOperator(UnaryOperator &I); - void visitBinaryOperator(BinaryOperator &I); - void visitICmpInst(ICmpInst &I); - void visitFCmpInst(FCmpInst &I); - - void visitCastInst(CastInst &I); - void visitSelectInst(SelectInst &I); - void visitCallInst(CallInst &I); - void visitInlineAsm(CallInst &I); - bool visitBuiltinCall(CallInst &I, Intrinsic::ID ID); - - void visitAllocaInst(AllocaInst &I); - void visitLoadInst(LoadInst &I); - void visitStoreInst(StoreInst &I); - void visitFenceInst(FenceInst &I); - void visitGetElementPtrInst(GetElementPtrInst &I); - void visitVAArgInst(VAArgInst &I); - - void visitInsertElementInst(InsertElementInst &I); - void visitExtractElementInst(ExtractElementInst &I); - void visitShuffleVectorInst(ShuffleVectorInst &SVI); - - void visitInsertValueInst(InsertValueInst &I); - void visitExtractValueInst(ExtractValueInst &I); - - void visitInstruction(Instruction &I) { - CurInstr = &I; - errorWithMessage("unsupported LLVM instruction"); - } - - [[noreturn]] void errorWithMessage(const char *message); - - bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); - bool canDeclareLocalLate(Instruction &I); - void printPHICopiesForSuccessor(BasicBlock *CurBlock, BasicBlock *Successor, - unsigned Indent); - void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, - unsigned Indent); - void printGEPExpression(Value *Ptr, gep_type_iterator I, gep_type_iterator E); - - std::string GetValueName(Value *Operand); - - friend class CWriterTestHelper; -}; + // generateCompilerSpecificCode() + USED_HEADERS_FLAG(BuiltinAlloca) + USED_HEADERS_FLAG(Unreachable) + USED_HEADERS_FLAG(NoReturn) + USED_HEADERS_FLAG(ExternalWeak) + USED_HEADERS_FLAG(AttributeWeak) + USED_HEADERS_FLAG(Hidden) + USED_HEADERS_FLAG(AttributeList) + USED_HEADERS_FLAG(UnalignedLoad) + USED_HEADERS_FLAG(Aligns) + USED_HEADERS_FLAG(NanInf) + USED_HEADERS_FLAG(Int128) + USED_HEADERS_FLAG(ThreadFence) + USED_HEADERS_FLAG(StackSaveRestore) + USED_HEADERS_FLAG(ConstantDoubleTy) + USED_HEADERS_FLAG(ConstantFloatTy) + USED_HEADERS_FLAG(ConstantFP80Ty) + USED_HEADERS_FLAG(ConstantFP128Ty) + USED_HEADERS_FLAG(ForceInline) + + llvm::SmallSet FCmpOps; + void headerUseFCmpOp(CmpInst::Predicate P); + + void generateCompilerSpecificCode(raw_ostream &Out, + const DataLayout *) const; + + public: + static char ID; + explicit CWriter(raw_ostream &o) + : FunctionPass(ID), OutHeaders(_OutHeaders), Out(_Out), FileOut(o) { + memset(&UsedHeaders, 0, sizeof(UsedHeaders)); + } + + virtual StringRef getPassName() const { return "C backend"; } + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.setPreservesCFG(); + } + + virtual bool doInitialization(Module &M); + virtual bool doFinalization(Module &M); + virtual bool runOnFunction(Function &F); + + private: + void generateHeader(Module &M); + void declareOneGlobalVariable(GlobalVariable *I); + + void forwardDeclareStructs(raw_ostream &Out, Type *Ty, + std::set &TypesPrinted); + + raw_ostream &printFunctionAttributes(raw_ostream &Out, AttributeList Attrs); + + bool isStandardMain(const FunctionType *FTy); + raw_ostream & + printFunctionProto(raw_ostream &Out, FunctionType *Ty, + std::pair Attrs, + const std::string &Name, + iterator_range *ArgList); + raw_ostream &printFunctionProto(raw_ostream &Out, Function *F) { + return printFunctionProto( + Out, F->getFunctionType(), + std::make_pair(F->getAttributes(), F->getCallingConv()), + GetValueName(F), nullptr); + } + + raw_ostream &printFunctionDeclaration( + raw_ostream &Out, FunctionType *Ty, + std::pair PAL = + std::make_pair(AttributeList(), CallingConv::C)); + raw_ostream &printStructDeclaration(raw_ostream &Out, StructType *Ty); + raw_ostream &printArrayDeclaration(raw_ostream &Out, ArrayType *Ty); + raw_ostream &printVectorDeclaration(raw_ostream &Out, VectorType *Ty); + + raw_ostream & + printTypeName(raw_ostream &Out, Type *Ty, bool isSigned = false, + std::pair PAL = + std::make_pair(AttributeList(), CallingConv::C)); + raw_ostream &printTypeNameForAddressableValue(raw_ostream &Out, Type *Ty, + bool isSigned = false); + raw_ostream &printSimpleType(raw_ostream &Out, Type *Ty, bool isSigned); + raw_ostream &printTypeString(raw_ostream &Out, Type *Ty, bool isSigned); + + std::string getStructName(StructType *ST); + std::string getFunctionName(FunctionType *FT, + std::pair PAL = + std::make_pair(AttributeList(), + CallingConv::C)); + std::string getArrayName(ArrayType *AT); + std::string getVectorName(VectorType *VT); + + enum OperandContext { + ContextNormal, + ContextCasted, + // Casted context means the type-cast will be implicit, + // such as the RHS of a `var = RHS;` expression + // or inside a struct initializer expression + ContextStatic + // Static context means that it is being used in as a static initializer + // (also implies ContextCasted) + }; + + void writeOperandDeref(Value *Operand); + void writeOperand(Value *Operand, + enum OperandContext Context = ContextNormal); + void writeInstComputationInline(Instruction &I); + void writeOperandInternal(Value *Operand, + enum OperandContext Context = ContextNormal); + void writeOperandWithCast(Value *Operand, unsigned Opcode); + void opcodeNeedsCast(unsigned Opcode, bool &shouldCast, bool &castIsSigned); + + void writeOperandWithCast(Value *Operand, ICmpInst &I); + bool writeInstructionCast(Instruction &I); + void writeMemoryAccess(Value *Operand, Type *OperandType, bool IsVolatile, + unsigned Alignment); + + std::string InterpretASMConstraint(InlineAsm::ConstraintInfo &c); + + bool lowerIntrinsics(Function &F); + /// Prints the definition of the intrinsic function F. Supports the + /// intrinsics which need to be explicitly defined in the CBackend. + void printIntrinsicDefinition(Function &F, raw_ostream &Out); + void printIntrinsicDefinition(FunctionType *funT, unsigned Opcode, + std::string OpName, raw_ostream &Out); + + void printModuleTypes(raw_ostream &Out); + void printContainedTypes(raw_ostream &Out, Type *Ty, std::set &); + + void printFloatingPointConstants(Function &F); + void printFloatingPointConstants(const Constant *C); + + void printFunction(Function &); + void printBasicBlock(BasicBlock *BB); + void printLoop(Loop *L); + + void printCast(unsigned opcode, Type *SrcTy, Type *DstTy); + void printConstant(Constant *CPV, enum OperandContext Context); + void printConstantWithCast(Constant *CPV, unsigned Opcode); + bool printConstExprCast(ConstantExpr *CE); + void printConstantArray(ConstantArray *CPA, enum OperandContext Context); + void printConstantVector(ConstantVector *CV, enum OperandContext Context); + void printConstantDataSequential(ConstantDataSequential *CDS, + enum OperandContext Context); + bool printConstantString(Constant *C, enum OperandContext Context); + + bool isEmptyType(Type *Ty) const; + Type *skipEmptyArrayTypes(Type *Ty) const; + bool isAddressExposed(Value *V) const; + bool isInlinableInst(Instruction &I) const; + AllocaInst *isDirectAlloca(Value *V) const; + bool isInlineAsm(Instruction &I) const; + + // Instruction visitation functions + friend class InstVisitor; + + void visitReturnInst(ReturnInst &I); + void visitBranchInst(BranchInst &I); + void visitSwitchInst(SwitchInst &I); + void visitIndirectBrInst(IndirectBrInst &I); + void visitInvokeInst(InvokeInst &I) { + llvm_unreachable("Lowerinvoke pass didn't work!"); + } + void visitResumeInst(ResumeInst &I) { + llvm_unreachable("DwarfEHPrepare pass didn't work!"); + } + void visitUnreachableInst(UnreachableInst &I); + + void visitPHINode(PHINode &I); + void visitUnaryOperator(UnaryOperator &I); + void visitBinaryOperator(BinaryOperator &I); + void visitICmpInst(ICmpInst &I); + void visitFCmpInst(FCmpInst &I); + + void visitCastInst(CastInst &I); + void visitSelectInst(SelectInst &I); + void visitCallInst(CallInst &I); + void visitInlineAsm(CallInst &I); + bool visitBuiltinCall(CallInst &I, Intrinsic::ID ID); + + void visitAllocaInst(AllocaInst &I); + void visitLoadInst(LoadInst &I); + void visitStoreInst(StoreInst &I); + void visitFenceInst(FenceInst &I); + void visitGetElementPtrInst(GetElementPtrInst &I); + void visitVAArgInst(VAArgInst &I); + + void visitInsertElementInst(InsertElementInst &I); + void visitExtractElementInst(ExtractElementInst &I); + void visitShuffleVectorInst(ShuffleVectorInst &SVI); + + void visitInsertValueInst(InsertValueInst &I); + void visitExtractValueInst(ExtractValueInst &I); + + void visitInstruction(Instruction &I) { + CurInstr = &I; + errorWithMessage("unsupported LLVM instruction"); + } + + [[noreturn]] void errorWithMessage(const char *message); + + bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); + bool canDeclareLocalLate(Instruction &I); + void printPHICopiesForSuccessor(BasicBlock *CurBlock, BasicBlock *Successor, + unsigned Indent); + void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, + unsigned Indent); + void printGEPExpression(Value *Ptr, gep_type_iterator I, + gep_type_iterator E); + + std::string GetValueName(Value *Operand); + + friend class CWriterTestHelper; + }; } // namespace llvm_cbe From 42219b03ba7b3fcb9e02e9a5bb36339896eee21d Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 19 Jul 2023 14:40:31 -0700 Subject: [PATCH 3/3] Fix typo --- lib/Target/CBackend/CBackend.h | 600 ++++++++++++++++----------------- 1 file changed, 299 insertions(+), 301 deletions(-) diff --git a/lib/Target/CBackend/CBackend.h b/lib/Target/CBackend/CBackend.h index 2c388943..9c93e328 100644 --- a/lib/Target/CBackend/CBackend.h +++ b/lib/Target/CBackend/CBackend.h @@ -1,4 +1,4 @@ -/===-- CBackend.h - Library for converting LLVM code to C ----------------===// +//===-- CBackend.h - Library for converting LLVM code to C ----------------===// // // The LLVM Compiler Infrastructure // @@ -53,313 +53,311 @@ namespace llvm_cbe { - using namespace llvm; +using namespace llvm; + +class CBEMCAsmInfo : public MCAsmInfo { +public: + CBEMCAsmInfo() { PrivateGlobalPrefix = ""; } +}; + +/// CWriter - This class is the main chunk of code that converts an LLVM +/// module to a C translation unit. +class CWriter : public FunctionPass, public InstVisitor { + std::string _Out; + std::string _OutHeaders; + raw_string_ostream OutHeaders; + raw_string_ostream Out; + raw_ostream &FileOut; + IntrinsicLowering *IL = nullptr; + LoopInfo *LI = nullptr; + const Module *TheModule = nullptr; + const MCAsmInfo *TAsm = nullptr; + const MCRegisterInfo *MRI = nullptr; + const MCObjectFileInfo *MOFI = nullptr; + MCContext *TCtx = nullptr; + const DataLayout *TD = nullptr; + const Instruction *CurInstr = nullptr; + + IDMap FPConstantMap; + + IDMap AnonValueNumbers; + + /// UnnamedStructIDs - This contains a unique ID for each struct that is + /// either anonymous or has no name. + IDMap UnnamedStructIDs; + + std::set TypedefDeclTypes; + std::set SelectDeclTypes; + std::set> CmpDeclTypes; + std::set>> + CastOpDeclTypes; + std::set> InlineOpDeclTypes; + std::set CtorDeclTypes; + + IDMap>> + UnnamedFunctionIDs; + + // This is used to keep track of intrinsics that get generated to a lowered + // function. We must generate the prototypes before the function body which + // will only be expanded on first use + std::vector prototypesToGen; + + unsigned LastAnnotatedSourceLine = 0; + + struct { + // Standard headers + bool Stdarg : 1; + bool Setjmp : 1; + bool Limits : 1; + bool Math : 1; - class CBEMCAsmInfo : public MCAsmInfo { - public: - CBEMCAsmInfo() { PrivateGlobalPrefix = ""; } - }; + // printModuleTypes() + bool BitCastUnion : 1; - /// CWriter - This class is the main chunk of code that converts an LLVM - /// module to a C translation unit. - class CWriter : public FunctionPass, public InstVisitor { - std::string _Out; - std::string _OutHeaders; - raw_string_ostream OutHeaders; - raw_string_ostream Out; - raw_ostream &FileOut; - IntrinsicLowering *IL = nullptr; - LoopInfo *LI = nullptr; - const Module *TheModule = nullptr; - const MCAsmInfo *TAsm = nullptr; - const MCRegisterInfo *MRI = nullptr; - const MCObjectFileInfo *MOFI = nullptr; - MCContext *TCtx = nullptr; - const DataLayout *TD = nullptr; - const Instruction *CurInstr = nullptr; - - IDMap FPConstantMap; - - IDMap AnonValueNumbers; - - /// UnnamedStructIDs - This contains a unique ID for each struct that is - /// either anonymous or has no name. - IDMap UnnamedStructIDs; - - std::set TypedefDeclTypes; - std::set SelectDeclTypes; - std::set> CmpDeclTypes; - std::set>> - CastOpDeclTypes; - std::set> InlineOpDeclTypes; - std::set CtorDeclTypes; - - IDMap>> - UnnamedFunctionIDs; - - // This is used to keep track of intrinsics that get generated to a lowered - // function. We must generate the prototypes before the function body which - // will only be expanded on first use - std::vector prototypesToGen; - - unsigned LastAnnotatedSourceLine = 0; - - struct { - // Standard headers - bool Stdarg : 1; - bool Setjmp : 1; - bool Limits : 1; - bool Math : 1; - - // printModuleTypes() - bool BitCastUnion : 1; - - // generateCompilerSpecificCode() - bool BuiltinAlloca : 1; - bool Unreachable : 1; - bool NoReturn : 1; - bool ExternalWeak : 1; - bool AttributeWeak : 1; - bool Hidden : 1; - bool AttributeList : 1; - bool UnalignedLoad : 1; - bool Aligns : 1; - bool NanInf : 1; - bool Int128 : 1; - bool ThreadFence : 1; - bool StackSaveRestore : 1; - bool ConstantDoubleTy : 1; - bool ConstantFloatTy : 1; - bool ConstantFP80Ty : 1; - bool ConstantFP128Ty : 1; - bool ForceInline : 1; - } UsedHeaders; + // generateCompilerSpecificCode() + bool BuiltinAlloca : 1; + bool Unreachable : 1; + bool NoReturn : 1; + bool ExternalWeak : 1; + bool AttributeWeak : 1; + bool Hidden : 1; + bool AttributeList : 1; + bool UnalignedLoad : 1; + bool Aligns : 1; + bool NanInf : 1; + bool Int128 : 1; + bool ThreadFence : 1; + bool StackSaveRestore : 1; + bool ConstantDoubleTy : 1; + bool ConstantFloatTy : 1; + bool ConstantFP80Ty : 1; + bool ConstantFP128Ty : 1; + bool ForceInline : 1; + } UsedHeaders; #define USED_HEADERS_FLAG(Name) \ void headerUse##Name() { UsedHeaders.Name = true; } \ bool headerInc##Name() const { return UsedHeaders.Name; } - // Standard headers - USED_HEADERS_FLAG(Stdarg) - USED_HEADERS_FLAG(Setjmp) - USED_HEADERS_FLAG(Limits) - USED_HEADERS_FLAG(Math) - - // printModuleTypes() - USED_HEADERS_FLAG(BitCastUnion) - - // generateCompilerSpecificCode() - USED_HEADERS_FLAG(BuiltinAlloca) - USED_HEADERS_FLAG(Unreachable) - USED_HEADERS_FLAG(NoReturn) - USED_HEADERS_FLAG(ExternalWeak) - USED_HEADERS_FLAG(AttributeWeak) - USED_HEADERS_FLAG(Hidden) - USED_HEADERS_FLAG(AttributeList) - USED_HEADERS_FLAG(UnalignedLoad) - USED_HEADERS_FLAG(Aligns) - USED_HEADERS_FLAG(NanInf) - USED_HEADERS_FLAG(Int128) - USED_HEADERS_FLAG(ThreadFence) - USED_HEADERS_FLAG(StackSaveRestore) - USED_HEADERS_FLAG(ConstantDoubleTy) - USED_HEADERS_FLAG(ConstantFloatTy) - USED_HEADERS_FLAG(ConstantFP80Ty) - USED_HEADERS_FLAG(ConstantFP128Ty) - USED_HEADERS_FLAG(ForceInline) - - llvm::SmallSet FCmpOps; - void headerUseFCmpOp(CmpInst::Predicate P); - - void generateCompilerSpecificCode(raw_ostream &Out, - const DataLayout *) const; - - public: - static char ID; - explicit CWriter(raw_ostream &o) - : FunctionPass(ID), OutHeaders(_OutHeaders), Out(_Out), FileOut(o) { - memset(&UsedHeaders, 0, sizeof(UsedHeaders)); - } - - virtual StringRef getPassName() const { return "C backend"; } - - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - AU.setPreservesCFG(); - } - - virtual bool doInitialization(Module &M); - virtual bool doFinalization(Module &M); - virtual bool runOnFunction(Function &F); - - private: - void generateHeader(Module &M); - void declareOneGlobalVariable(GlobalVariable *I); - - void forwardDeclareStructs(raw_ostream &Out, Type *Ty, - std::set &TypesPrinted); - - raw_ostream &printFunctionAttributes(raw_ostream &Out, AttributeList Attrs); - - bool isStandardMain(const FunctionType *FTy); - raw_ostream & - printFunctionProto(raw_ostream &Out, FunctionType *Ty, - std::pair Attrs, - const std::string &Name, - iterator_range *ArgList); - raw_ostream &printFunctionProto(raw_ostream &Out, Function *F) { - return printFunctionProto( - Out, F->getFunctionType(), - std::make_pair(F->getAttributes(), F->getCallingConv()), - GetValueName(F), nullptr); - } - - raw_ostream &printFunctionDeclaration( - raw_ostream &Out, FunctionType *Ty, - std::pair PAL = - std::make_pair(AttributeList(), CallingConv::C)); - raw_ostream &printStructDeclaration(raw_ostream &Out, StructType *Ty); - raw_ostream &printArrayDeclaration(raw_ostream &Out, ArrayType *Ty); - raw_ostream &printVectorDeclaration(raw_ostream &Out, VectorType *Ty); - - raw_ostream & - printTypeName(raw_ostream &Out, Type *Ty, bool isSigned = false, - std::pair PAL = - std::make_pair(AttributeList(), CallingConv::C)); - raw_ostream &printTypeNameForAddressableValue(raw_ostream &Out, Type *Ty, - bool isSigned = false); - raw_ostream &printSimpleType(raw_ostream &Out, Type *Ty, bool isSigned); - raw_ostream &printTypeString(raw_ostream &Out, Type *Ty, bool isSigned); - - std::string getStructName(StructType *ST); - std::string getFunctionName(FunctionType *FT, - std::pair PAL = - std::make_pair(AttributeList(), - CallingConv::C)); - std::string getArrayName(ArrayType *AT); - std::string getVectorName(VectorType *VT); - - enum OperandContext { - ContextNormal, - ContextCasted, - // Casted context means the type-cast will be implicit, - // such as the RHS of a `var = RHS;` expression - // or inside a struct initializer expression - ContextStatic - // Static context means that it is being used in as a static initializer - // (also implies ContextCasted) - }; - - void writeOperandDeref(Value *Operand); - void writeOperand(Value *Operand, - enum OperandContext Context = ContextNormal); - void writeInstComputationInline(Instruction &I); - void writeOperandInternal(Value *Operand, - enum OperandContext Context = ContextNormal); - void writeOperandWithCast(Value *Operand, unsigned Opcode); - void opcodeNeedsCast(unsigned Opcode, bool &shouldCast, bool &castIsSigned); - - void writeOperandWithCast(Value *Operand, ICmpInst &I); - bool writeInstructionCast(Instruction &I); - void writeMemoryAccess(Value *Operand, Type *OperandType, bool IsVolatile, - unsigned Alignment); - - std::string InterpretASMConstraint(InlineAsm::ConstraintInfo &c); - - bool lowerIntrinsics(Function &F); - /// Prints the definition of the intrinsic function F. Supports the - /// intrinsics which need to be explicitly defined in the CBackend. - void printIntrinsicDefinition(Function &F, raw_ostream &Out); - void printIntrinsicDefinition(FunctionType *funT, unsigned Opcode, - std::string OpName, raw_ostream &Out); - - void printModuleTypes(raw_ostream &Out); - void printContainedTypes(raw_ostream &Out, Type *Ty, std::set &); - - void printFloatingPointConstants(Function &F); - void printFloatingPointConstants(const Constant *C); - - void printFunction(Function &); - void printBasicBlock(BasicBlock *BB); - void printLoop(Loop *L); - - void printCast(unsigned opcode, Type *SrcTy, Type *DstTy); - void printConstant(Constant *CPV, enum OperandContext Context); - void printConstantWithCast(Constant *CPV, unsigned Opcode); - bool printConstExprCast(ConstantExpr *CE); - void printConstantArray(ConstantArray *CPA, enum OperandContext Context); - void printConstantVector(ConstantVector *CV, enum OperandContext Context); - void printConstantDataSequential(ConstantDataSequential *CDS, - enum OperandContext Context); - bool printConstantString(Constant *C, enum OperandContext Context); - - bool isEmptyType(Type *Ty) const; - Type *skipEmptyArrayTypes(Type *Ty) const; - bool isAddressExposed(Value *V) const; - bool isInlinableInst(Instruction &I) const; - AllocaInst *isDirectAlloca(Value *V) const; - bool isInlineAsm(Instruction &I) const; - - // Instruction visitation functions - friend class InstVisitor; - - void visitReturnInst(ReturnInst &I); - void visitBranchInst(BranchInst &I); - void visitSwitchInst(SwitchInst &I); - void visitIndirectBrInst(IndirectBrInst &I); - void visitInvokeInst(InvokeInst &I) { - llvm_unreachable("Lowerinvoke pass didn't work!"); - } - void visitResumeInst(ResumeInst &I) { - llvm_unreachable("DwarfEHPrepare pass didn't work!"); - } - void visitUnreachableInst(UnreachableInst &I); - - void visitPHINode(PHINode &I); - void visitUnaryOperator(UnaryOperator &I); - void visitBinaryOperator(BinaryOperator &I); - void visitICmpInst(ICmpInst &I); - void visitFCmpInst(FCmpInst &I); - - void visitCastInst(CastInst &I); - void visitSelectInst(SelectInst &I); - void visitCallInst(CallInst &I); - void visitInlineAsm(CallInst &I); - bool visitBuiltinCall(CallInst &I, Intrinsic::ID ID); - - void visitAllocaInst(AllocaInst &I); - void visitLoadInst(LoadInst &I); - void visitStoreInst(StoreInst &I); - void visitFenceInst(FenceInst &I); - void visitGetElementPtrInst(GetElementPtrInst &I); - void visitVAArgInst(VAArgInst &I); - - void visitInsertElementInst(InsertElementInst &I); - void visitExtractElementInst(ExtractElementInst &I); - void visitShuffleVectorInst(ShuffleVectorInst &SVI); - - void visitInsertValueInst(InsertValueInst &I); - void visitExtractValueInst(ExtractValueInst &I); - - void visitInstruction(Instruction &I) { - CurInstr = &I; - errorWithMessage("unsupported LLVM instruction"); - } - - [[noreturn]] void errorWithMessage(const char *message); - - bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); - bool canDeclareLocalLate(Instruction &I); - void printPHICopiesForSuccessor(BasicBlock *CurBlock, BasicBlock *Successor, - unsigned Indent); - void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, - unsigned Indent); - void printGEPExpression(Value *Ptr, gep_type_iterator I, - gep_type_iterator E); - - std::string GetValueName(Value *Operand); - - friend class CWriterTestHelper; + // Standard headers + USED_HEADERS_FLAG(Stdarg) + USED_HEADERS_FLAG(Setjmp) + USED_HEADERS_FLAG(Limits) + USED_HEADERS_FLAG(Math) + + // printModuleTypes() + USED_HEADERS_FLAG(BitCastUnion) + + // generateCompilerSpecificCode() + USED_HEADERS_FLAG(BuiltinAlloca) + USED_HEADERS_FLAG(Unreachable) + USED_HEADERS_FLAG(NoReturn) + USED_HEADERS_FLAG(ExternalWeak) + USED_HEADERS_FLAG(AttributeWeak) + USED_HEADERS_FLAG(Hidden) + USED_HEADERS_FLAG(AttributeList) + USED_HEADERS_FLAG(UnalignedLoad) + USED_HEADERS_FLAG(Aligns) + USED_HEADERS_FLAG(NanInf) + USED_HEADERS_FLAG(Int128) + USED_HEADERS_FLAG(ThreadFence) + USED_HEADERS_FLAG(StackSaveRestore) + USED_HEADERS_FLAG(ConstantDoubleTy) + USED_HEADERS_FLAG(ConstantFloatTy) + USED_HEADERS_FLAG(ConstantFP80Ty) + USED_HEADERS_FLAG(ConstantFP128Ty) + USED_HEADERS_FLAG(ForceInline) + + llvm::SmallSet FCmpOps; + void headerUseFCmpOp(CmpInst::Predicate P); + + void generateCompilerSpecificCode(raw_ostream &Out, const DataLayout *) const; + +public: + static char ID; + explicit CWriter(raw_ostream &o) + : FunctionPass(ID), OutHeaders(_OutHeaders), Out(_Out), FileOut(o) { + memset(&UsedHeaders, 0, sizeof(UsedHeaders)); + } + + virtual StringRef getPassName() const { return "C backend"; } + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.setPreservesCFG(); + } + + virtual bool doInitialization(Module &M); + virtual bool doFinalization(Module &M); + virtual bool runOnFunction(Function &F); + +private: + void generateHeader(Module &M); + void declareOneGlobalVariable(GlobalVariable *I); + + void forwardDeclareStructs(raw_ostream &Out, Type *Ty, + std::set &TypesPrinted); + + raw_ostream &printFunctionAttributes(raw_ostream &Out, AttributeList Attrs); + + bool isStandardMain(const FunctionType *FTy); + raw_ostream & + printFunctionProto(raw_ostream &Out, FunctionType *Ty, + std::pair Attrs, + const std::string &Name, + iterator_range *ArgList); + raw_ostream &printFunctionProto(raw_ostream &Out, Function *F) { + return printFunctionProto( + Out, F->getFunctionType(), + std::make_pair(F->getAttributes(), F->getCallingConv()), + GetValueName(F), nullptr); + } + + raw_ostream & + printFunctionDeclaration(raw_ostream &Out, FunctionType *Ty, + std::pair PAL = + std::make_pair(AttributeList(), CallingConv::C)); + raw_ostream &printStructDeclaration(raw_ostream &Out, StructType *Ty); + raw_ostream &printArrayDeclaration(raw_ostream &Out, ArrayType *Ty); + raw_ostream &printVectorDeclaration(raw_ostream &Out, VectorType *Ty); + + raw_ostream &printTypeName(raw_ostream &Out, Type *Ty, bool isSigned = false, + std::pair PAL = + std::make_pair(AttributeList(), + CallingConv::C)); + raw_ostream &printTypeNameForAddressableValue(raw_ostream &Out, Type *Ty, + bool isSigned = false); + raw_ostream &printSimpleType(raw_ostream &Out, Type *Ty, bool isSigned); + raw_ostream &printTypeString(raw_ostream &Out, Type *Ty, bool isSigned); + + std::string getStructName(StructType *ST); + std::string getFunctionName(FunctionType *FT, + std::pair PAL = + std::make_pair(AttributeList(), + CallingConv::C)); + std::string getArrayName(ArrayType *AT); + std::string getVectorName(VectorType *VT); + + enum OperandContext { + ContextNormal, + ContextCasted, + // Casted context means the type-cast will be implicit, + // such as the RHS of a `var = RHS;` expression + // or inside a struct initializer expression + ContextStatic + // Static context means that it is being used in as a static initializer + // (also implies ContextCasted) }; + void writeOperandDeref(Value *Operand); + void writeOperand(Value *Operand, + enum OperandContext Context = ContextNormal); + void writeInstComputationInline(Instruction &I); + void writeOperandInternal(Value *Operand, + enum OperandContext Context = ContextNormal); + void writeOperandWithCast(Value *Operand, unsigned Opcode); + void opcodeNeedsCast(unsigned Opcode, bool &shouldCast, bool &castIsSigned); + + void writeOperandWithCast(Value *Operand, ICmpInst &I); + bool writeInstructionCast(Instruction &I); + void writeMemoryAccess(Value *Operand, Type *OperandType, bool IsVolatile, + unsigned Alignment); + + std::string InterpretASMConstraint(InlineAsm::ConstraintInfo &c); + + bool lowerIntrinsics(Function &F); + /// Prints the definition of the intrinsic function F. Supports the + /// intrinsics which need to be explicitly defined in the CBackend. + void printIntrinsicDefinition(Function &F, raw_ostream &Out); + void printIntrinsicDefinition(FunctionType *funT, unsigned Opcode, + std::string OpName, raw_ostream &Out); + + void printModuleTypes(raw_ostream &Out); + void printContainedTypes(raw_ostream &Out, Type *Ty, std::set &); + + void printFloatingPointConstants(Function &F); + void printFloatingPointConstants(const Constant *C); + + void printFunction(Function &); + void printBasicBlock(BasicBlock *BB); + void printLoop(Loop *L); + + void printCast(unsigned opcode, Type *SrcTy, Type *DstTy); + void printConstant(Constant *CPV, enum OperandContext Context); + void printConstantWithCast(Constant *CPV, unsigned Opcode); + bool printConstExprCast(ConstantExpr *CE); + void printConstantArray(ConstantArray *CPA, enum OperandContext Context); + void printConstantVector(ConstantVector *CV, enum OperandContext Context); + void printConstantDataSequential(ConstantDataSequential *CDS, + enum OperandContext Context); + bool printConstantString(Constant *C, enum OperandContext Context); + + bool isEmptyType(Type *Ty) const; + Type *skipEmptyArrayTypes(Type *Ty) const; + bool isAddressExposed(Value *V) const; + bool isInlinableInst(Instruction &I) const; + AllocaInst *isDirectAlloca(Value *V) const; + bool isInlineAsm(Instruction &I) const; + + // Instruction visitation functions + friend class InstVisitor; + + void visitReturnInst(ReturnInst &I); + void visitBranchInst(BranchInst &I); + void visitSwitchInst(SwitchInst &I); + void visitIndirectBrInst(IndirectBrInst &I); + void visitInvokeInst(InvokeInst &I) { + llvm_unreachable("Lowerinvoke pass didn't work!"); + } + void visitResumeInst(ResumeInst &I) { + llvm_unreachable("DwarfEHPrepare pass didn't work!"); + } + void visitUnreachableInst(UnreachableInst &I); + + void visitPHINode(PHINode &I); + void visitUnaryOperator(UnaryOperator &I); + void visitBinaryOperator(BinaryOperator &I); + void visitICmpInst(ICmpInst &I); + void visitFCmpInst(FCmpInst &I); + + void visitCastInst(CastInst &I); + void visitSelectInst(SelectInst &I); + void visitCallInst(CallInst &I); + void visitInlineAsm(CallInst &I); + bool visitBuiltinCall(CallInst &I, Intrinsic::ID ID); + + void visitAllocaInst(AllocaInst &I); + void visitLoadInst(LoadInst &I); + void visitStoreInst(StoreInst &I); + void visitFenceInst(FenceInst &I); + void visitGetElementPtrInst(GetElementPtrInst &I); + void visitVAArgInst(VAArgInst &I); + + void visitInsertElementInst(InsertElementInst &I); + void visitExtractElementInst(ExtractElementInst &I); + void visitShuffleVectorInst(ShuffleVectorInst &SVI); + + void visitInsertValueInst(InsertValueInst &I); + void visitExtractValueInst(ExtractValueInst &I); + + void visitInstruction(Instruction &I) { + CurInstr = &I; + errorWithMessage("unsupported LLVM instruction"); + } + + [[noreturn]] void errorWithMessage(const char *message); + + bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); + bool canDeclareLocalLate(Instruction &I); + void printPHICopiesForSuccessor(BasicBlock *CurBlock, BasicBlock *Successor, + unsigned Indent); + void printBranchToBlock(BasicBlock *CurBlock, BasicBlock *SuccBlock, + unsigned Indent); + void printGEPExpression(Value *Ptr, gep_type_iterator I, gep_type_iterator E); + + std::string GetValueName(Value *Operand); + + friend class CWriterTestHelper; +}; + } // namespace llvm_cbe