[PATCH] D106065: [Clang] Add an empty builtins.h file.
Stefan Pintilie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 15 18:28:21 PDT 2021
stefanp updated this revision to Diff 359186.
stefanp added a comment.
Added comment to the builtins.h file.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106065/new/
https://reviews.llvm.org/D106065
Files:
clang/lib/Headers/CMakeLists.txt
clang/lib/Headers/builtins.h
clang/test/Headers/builtins-header.c
Index: clang/test/Headers/builtins-header.c
===================================================================
--- /dev/null
+++ clang/test/Headers/builtins-header.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -ffreestanding -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -ffreestanding -emit-llvm -o - %s | FileCheck %s
+
+#include <builtins.h>
+
+// Verify that we can include <builtins.h>
+
+// CHECK: target triple = "powerpc64
Index: clang/lib/Headers/builtins.h
===================================================================
--- /dev/null
+++ clang/lib/Headers/builtins.h
@@ -0,0 +1,16 @@
+/*===---- builtins.h - Standard header for extra builtins -----------------===*\
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+\*===----------------------------------------------------------------------===*/
+
+/// Some legacy compilers have builtin definitions in a file named builtins.h.
+/// This header file has been added to allow compatibility with code that was
+/// written for those compilers. Code may have an include line for this file
+/// and to avoid an error an empty file with this name is provided.
+#ifndef __BUILTINS_H
+#define __BUILTINS_H
+
+#endif /* __BUILTINS_H */
Index: clang/lib/Headers/CMakeLists.txt
===================================================================
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -38,6 +38,7 @@
avxvnniintrin.h
bmi2intrin.h
bmiintrin.h
+ builtins.h
__clang_cuda_builtin_vars.h
__clang_cuda_math.h
__clang_cuda_cmath.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106065.359186.patch
Type: text/x-patch
Size: 1769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210716/9c53c329/attachment.bin>
More information about the llvm-commits
mailing list