aboutsummaryrefslogtreecommitdiff
path: root/rcc/include
diff options
context:
space:
mode:
Diffstat (limited to 'rcc/include')
-rw-r--r--rcc/include/rcc/Config/config.h.cmake82
-rw-r--r--rcc/include/rcc/Config/rcc-config.h.cmake98
-rw-r--r--rcc/include/rcc/Support/Compiler.h106
3 files changed, 286 insertions, 0 deletions
diff --git a/rcc/include/rcc/Config/config.h.cmake b/rcc/include/rcc/Config/config.h.cmake
new file mode 100644
index 0000000..8830412
--- /dev/null
+++ b/rcc/include/rcc/Config/config.h.cmake
@@ -0,0 +1,82 @@
+#ifndef RCC_PRIVATE_CONFIG_H
+#define RCC_PRIVATE_CONFIG_H
+
+// Include this header only under the rcc source tree.
+// This is a private header.
+
+/* Exported configuration */
+#include "rcc/Config/rcc-config.h"
+
+/* Bug report URL. */
+#define BUG_REPORT_URL "${BUG_REPORT_URL}"
+
+/* Define to 1 if we can register EH frames on this platform. */
+#cmakedefine HAVE_REGISTER_FRAME ${HAVE_REGISTER_FRAME}
+
+/* Define to 1 if we can deregister EH frames on this platform. */
+#cmakedefine HAVE_DEREGISTER_FRAME ${HAVE_DEREGISTER_FRAME}
+
+/* Define if __unw_add_dynamic_fde() is available on this platform. */
+#cmakedefine HAVE_UNW_ADD_DYNAMIC_FDE ${HAVE_UNW_ADD_DYNAMIC_FDE}
+
+/* Define if libffi is available on this platform. */
+#cmakedefine HAVE_FFI_CALL ${HAVE_FFI_CALL}
+
+/* Define to 1 if you have the <ffi/ffi.h> header file. */
+#cmakedefine HAVE_FFI_FFI_H ${HAVE_FFI_FFI_H}
+
+/* Define to 1 if you have the <ffi.h> header file. */
+#cmakedefine HAVE_FFI_H ${HAVE_FFI_H}
+
+/* Define to 1 if you have the `pfm' library (-lpfm). */
+#cmakedefine HAVE_LIBPFM ${HAVE_LIBPFM}
+
+/* Define to 1 if the `perf_branch_entry' struct has field cycles. */
+#cmakedefine LIBPFM_HAS_FIELD_CYCLES ${LIBPFM_HAS_FIELD_CYCLES}
+
+/* Linker version detected at compile time. */
+#cmakedefine HOST_LINK_VERSION "${HOST_LINK_VERSION}"
+
+/* Define if overriding target triple is enabled */
+#cmakedefine RCC_TARGET_TRIPLE_ENV "${RCC_TARGET_TRIPLE_ENV}"
+
+/* Whether tools show host and target info when invoked with --version */
+#cmakedefine01 RCC_VERSION_PRINTER_SHOW_HOST_TARGET_INFO
+
+/* Whether tools show optional build config flags when invoked with --version */
+#cmakedefine01 RCC_VERSION_PRINTER_SHOW_BUILD_CONFIG
+
+/* Define if libxml2 is supported on this platform. */
+#cmakedefine RCC_ENABLE_LIBXML2 ${RCC_ENABLE_LIBXML2}
+
+/* Define to the extension used for shared libraries, say, ".so". */
+#cmakedefine LTDL_SHLIB_EXT "${LTDL_SHLIB_EXT}"
+
+/* Define to the extension used for plugin libraries, say, ".so". */
+#cmakedefine RCC_PLUGIN_EXT "${RCC_PLUGIN_EXT}"
+
+/* Define to the address where bug reports for this package should be sent. */
+#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
+
+/* Define to the full name of this package. */
+#cmakedefine PACKAGE_NAME "${PACKAGE_NAME}"
+
+/* Define to the full name and version of this package. */
+#cmakedefine PACKAGE_STRING "${PACKAGE_STRING}"
+
+/* Define to the version of this package. */
+#cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}"
+
+/* Define to the vendor of this package. */
+#cmakedefine PACKAGE_VENDOR "${PACKAGE_VENDOR}"
+
+/* Whether GlobalISel rule coverage is being collected */
+#cmakedefine01 RCC_GISEL_COV_ENABLED
+
+/* Define to the default GlobalISel coverage file prefix */
+#cmakedefine RCC_GISEL_COV_PREFIX "${RCC_GISEL_COV_PREFIX}"
+
+/* Have host's builtin thread pointer. */
+#cmakedefine HAVE_BUILTIN_THREAD_POINTER ${HAVE_BUILTIN_THREAD_POINTER}
+
+#endif
diff --git a/rcc/include/rcc/Config/rcc-config.h.cmake b/rcc/include/rcc/Config/rcc-config.h.cmake
new file mode 100644
index 0000000..fb76d22
--- /dev/null
+++ b/rcc/include/rcc/Config/rcc-config.h.cmake
@@ -0,0 +1,98 @@
+/*===------- rcc/Config/rcc-config.h - RCC configuration -------*- C -*-===*/
+/* */
+/* 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 */
+/* */
+/*===----------------------------------------------------------------------===*/
+
+/* This file enumerates variables from the RCC configuration so that they
+ can be in exported headers and won't override package specific directives.
+ This is a C header that can be included in the RCC C headers. */
+
+#ifndef RCC_CONFIG_H
+#define RCC_CONFIG_H
+
+/* Target triple RCC will generate code for by default */
+/* Doesn't use `cmakedefine` because it is allowed to be empty. */
+#define RCC_DEFAULT_TARGET_TRIPLE "${RCC_DEFAULT_TARGET_TRIPLE}"
+
+/* Host triple RCC will be executed on */
+#cmakedefine RCC_HOST_TRIPLE "${RCC_HOST_TRIPLE}"
+
+/* RCC architecture name for the native architecture, if available */
+#cmakedefine RCC_NATIVE_ARCH ${RCC_NATIVE_ARCH}
+
+/* RCC name for the native AsmParser init function, if available */
+#cmakedefine RCC_NATIVE_ASMPARSER RCCInitialize${RCC_NATIVE_ARCH}AsmParser
+
+/* RCC name for the native AsmPrinter init function, if available */
+#cmakedefine RCC_NATIVE_ASMPRINTER RCCInitialize${RCC_NATIVE_ARCH}AsmPrinter
+
+/* RCC name for the native Disassembler init function, if available */
+#cmakedefine RCC_NATIVE_DISASSEMBLER RCCInitialize${RCC_NATIVE_ARCH}Disassembler
+
+/* RCC name for the native Target init function, if available */
+#cmakedefine RCC_NATIVE_TARGET RCCInitialize${RCC_NATIVE_ARCH}Target
+
+/* RCC name for the native TargetInfo init function, if available */
+#cmakedefine RCC_NATIVE_TARGETINFO RCCInitialize${RCC_NATIVE_ARCH}TargetInfo
+
+/* RCC name for the native target MC init function, if available */
+#cmakedefine RCC_NATIVE_TARGETMC RCCInitialize${RCC_NATIVE_ARCH}TargetMC
+
+/* RCC name for the native target MCA init function, if available */
+#cmakedefine RCC_NATIVE_TARGETMCA RCCInitialize${RCC_NATIVE_ARCH}TargetMCA
+
+/* Define if we have the Intel JIT API runtime support library */
+#cmakedefine01 RCC_USE_INTEL_JITEVENTS
+
+/* Define if we have the oprofile JIT-support library */
+#cmakedefine01 RCC_USE_OPROFILE
+
+/* Define if we have the perf JIT-support library */
+#cmakedefine01 RCC_USE_PERF
+
+/* Major version of the RCC API */
+#define RCC_VERSION_MAJOR ${RCC_VERSION_MAJOR}
+
+/* Minor version of the RCC API */
+#define RCC_VERSION_MINOR ${RCC_VERSION_MINOR}
+
+/* Patch version of the RCC API */
+#define RCC_VERSION_PATCH ${RCC_VERSION_PATCH}
+
+/* RCC version string */
+#define RCC_VERSION_STRING "${PACKAGE_VERSION}"
+
+/* Define if RCC is using tflite */
+#cmakedefine RCC_HAVE_TFLITE
+
+/* Define if we want to check profile consistency in lit tests */
+#cmakedefine RCC_ENABLE_PROFCHECK
+
+/* Define if building libRCC shared library */
+#cmakedefine RCC_BUILD_RCC_DYLIB
+
+/* Define if exporting RCC-C public interface for shared library */
+#cmakedefine RCC_ENABLE_RCC_C_EXPORT_ANNOTATIONS
+
+/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
+#cmakedefine01 RCC_ENABLE_DIA_SDK
+
+/* Define if plugins enabled */
+#cmakedefine RCC_ENABLE_PLUGINS
+
+/* Define if building RCC with RCC_ENABLE_TELEMETRY */
+#cmakedefine01 RCC_ENABLE_TELEMETRY
+
+/* Define to 1 to enable expensive checks for debug location coverage checking,
+ and to 0 otherwise. */
+#cmakedefine01 RCC_ENABLE_DEBUGLOC_TRACKING_COVERAGE
+
+/* Define to 1 to enable expensive tracking of the origin of debug location
+ coverage bugs, and to 0 otherwise. */
+#cmakedefine01 RCC_ENABLE_DEBUGLOC_TRACKING_ORIGIN
+
+#endif
diff --git a/rcc/include/rcc/Support/Compiler.h b/rcc/include/rcc/Support/Compiler.h
new file mode 100644
index 0000000..1076827
--- /dev/null
+++ b/rcc/include/rcc/Support/Compiler.h
@@ -0,0 +1,106 @@
+/*
+ RCC-Project
+
+ Copyright (C) 2026 Richard Qin
+
+ This file is part of RCC-Project.
+
+ RCC-Project is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your option) any
+ later version.
+
+ RCC-Project is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ RCC-Project; see the file COPYING. If not see
+ <http://www.gnu.org/licenses/>.
+*/
+
+//===-- rcc/Support/Compiler.h - RCC ABI support ---------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef RCC_SUPPORT_COMPILER_H
+#define RCC_SUPPORT_COMPILER_H
+
+#include "core/compiler/Compiler.h"
+#include "rcc/Config/rcc-config.h"
+
+/// RCC_EXTERNAL_VISIBILITY - classes, functions, and variables marked with
+/// this attribute will be made public and visible outside of a shared library.
+#if defined(RCC_BUILD_RCC_DYLIB) || defined(RCC_BUILD_SHARED_LIBS)
+#define RCC_EXTERNAL_VISIBILITY LIBBASE_ATTRIBUTE_VISIBILITY_DEFAULT
+#else
+#define RCC_EXTERNAL_VISIBILITY
+#endif
+
+/// RCC_LIBRARY_VISIBILITY - Mark symbols private to the RCC shared library.
+#if (!(defined(_WIN32) || defined(__CYGWIN__)) || \
+ ((defined(__MINGW32__) || defined(__CYGWIN__)) && defined(__clang__)))
+#define RCC_LIBRARY_VISIBILITY LIBBASE_ATTRIBUTE_VISIBILITY_HIDDEN
+#if defined(__clang__) && __clang_major__ < 15
+#define RCC_LIBRARY_VISIBILITY_NAMESPACE [[gnu::visibility("hidden")]]
+#else
+#define RCC_LIBRARY_VISIBILITY_NAMESPACE LIBBASE_ATTRIBUTE_VISIBILITY_HIDDEN
+#endif
+#define RCC_ALWAYS_EXPORT LIBBASE_ATTRIBUTE_VISIBILITY_DEFAULT
+#elif defined(_WIN32)
+#define RCC_ALWAYS_EXPORT __declspec(dllexport)
+#define RCC_LIBRARY_VISIBILITY
+#define RCC_LIBRARY_VISIBILITY_NAMESPACE
+#else
+#define RCC_LIBRARY_VISIBILITY
+#define RCC_ALWAYS_EXPORT
+#define RCC_LIBRARY_VISIBILITY_NAMESPACE
+#endif
+
+/// RCC_ABI is the main export macro for the RCC public interface.
+/// RCC_ABI_EXPORT always exports a symbol from the defining library.
+/// RCC_EXPORT_TEMPLATE marks explicit template instantiations.
+/// RCC_TEMPLATE_ABI marks extern template declarations.
+#ifndef RCC_ABI_GENERATING_ANNOTATIONS
+#define RCC_ABI_NOT_EXPORTED
+#if defined(RCC_ENABLE_RCC_EXPORT_ANNOTATIONS) && !defined(RCC_BUILD_STATIC)
+#if defined(_WIN32) && !defined(__MINGW32__)
+#if defined(RCC_EXPORTS)
+#define RCC_ABI __declspec(dllexport)
+#define RCC_TEMPLATE_ABI
+#define RCC_EXPORT_TEMPLATE __declspec(dllexport)
+#else
+#define RCC_ABI __declspec(dllimport)
+#define RCC_TEMPLATE_ABI __declspec(dllimport)
+#define RCC_EXPORT_TEMPLATE
+#endif
+#define RCC_ABI_EXPORT __declspec(dllexport)
+#elif __has_attribute(visibility)
+#if defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) || \
+ defined(__MVS__) || defined(__CYGWIN__)
+#define RCC_ABI LIBBASE_ATTRIBUTE_VISIBILITY_DEFAULT
+#define RCC_TEMPLATE_ABI RCC_ABI
+#define RCC_EXPORT_TEMPLATE
+#define RCC_ABI_EXPORT RCC_ABI
+#elif defined(__MACH__) || defined(__wasm__) || defined(__EMSCRIPTEN__)
+#define RCC_ABI LIBBASE_ATTRIBUTE_VISIBILITY_DEFAULT
+#define RCC_TEMPLATE_ABI
+#define RCC_EXPORT_TEMPLATE
+#define RCC_ABI_EXPORT RCC_ABI
+#endif
+#endif
+#endif
+#if !defined(RCC_ABI)
+#define RCC_ABI
+#define RCC_TEMPLATE_ABI
+#define RCC_EXPORT_TEMPLATE
+#define RCC_ABI_EXPORT
+#endif
+#define RCC_ABI_FOR_TEST RCC_ABI
+#endif
+
+#endif