From 1963e4b9c5ae0a32dcca77567cbe3e5656e64036 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 21 Mar 2018 00:48:05 +0000 Subject: [PATCH] Move DataTypes.h from Support to llvm-c to fix layering. Support depends on llvm-c (a few typedefs, macros, etc - Types.h, Disassembler.h, and TargetMachine.h. This could be done the other way - those macros/typedefs/etc could be moved into Support and used from llvm-c instead. If someone feels that's a better direction to go, happy to discuss it/try it out/etc. llvm-svn: 328065 --- llvm/CMakeLists.txt | 4 ++-- llvm/include/{llvm/Support => llvm-c}/DataTypes.h.cmake | 12 ++++++------ llvm/include/llvm/Support/DataTypes.h | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 8 deletions(-) rename llvm/include/{llvm/Support => llvm-c}/DataTypes.h.cmake (92%) create mode 100644 llvm/include/llvm/Support/DataTypes.h diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 3e40d7e..aebf7f7 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -745,8 +745,8 @@ configure_file( ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/abi-breaking.h.cmake ${LLVM_INCLUDE_DIR}/llvm/Config/abi-breaking.h) configure_file( - ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake - ${LLVM_INCLUDE_DIR}/llvm/Support/DataTypes.h) + ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/DataTypes.h.cmake + ${LLVM_INCLUDE_DIR}/llvm-c/DataTypes.h) # Add target for generating source rpm package. set(LLVM_SRPM_USER_BINARY_SPECFILE ${CMAKE_CURRENT_SOURCE_DIR}/llvm.spec.in diff --git a/llvm/include/llvm/Support/DataTypes.h.cmake b/llvm/include/llvm-c/DataTypes.h.cmake similarity index 92% rename from llvm/include/llvm/Support/DataTypes.h.cmake rename to llvm/include/llvm-c/DataTypes.h.cmake index a58e2e4..19799ef 100644 --- a/llvm/include/llvm/Support/DataTypes.h.cmake +++ b/llvm/include/llvm-c/DataTypes.h.cmake @@ -1,4 +1,4 @@ -/*===-- include/Support/DataTypes.h - Define fixed size types -----*- C -*-===*\ +/*===-- include/llvm-c/DataTypes.h - Define fixed size types ------*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| @@ -21,8 +21,8 @@ /* Please leave this file C-compatible. */ -#ifndef SUPPORT_DATATYPES_H -#define SUPPORT_DATATYPES_H +#ifndef LLVM_C_DATATYPES_H +#define LLVM_C_DATATYPES_H #cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H} #cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H} @@ -57,12 +57,12 @@ #if !defined(UINT32_MAX) # error "The standard header is not C++11 compliant. Must #define "\ - "__STDC_LIMIT_MACROS before #including Support/DataTypes.h" + "__STDC_LIMIT_MACROS before #including llvm-c/DataTypes.h" #endif #if !defined(UINT32_C) # error "The standard header is not C++11 compliant. Must #define "\ - "__STDC_CONSTANT_MACROS before #including Support/DataTypes.h" + "__STDC_CONSTANT_MACROS before #including llvm-c/DataTypes.h" #endif /* Note that includes , if this is a C99 system. */ @@ -132,4 +132,4 @@ typedef signed int ssize_t; #define HUGE_VALF (float)HUGE_VAL #endif -#endif /* SUPPORT_DATATYPES_H */ +#endif /* LLVM_C_DATATYPES_H */ diff --git a/llvm/include/llvm/Support/DataTypes.h b/llvm/include/llvm/Support/DataTypes.h new file mode 100644 index 0000000..ad60a5b --- /dev/null +++ b/llvm/include/llvm/Support/DataTypes.h @@ -0,0 +1,17 @@ +//===-- llvm/Support/DataTypes.h - Define fixed size types ------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Due to layering constraints (Support depends on llvm-c) this is a thin +// wrapper around the implementation that lives in llvm-c, though most clients +// can/should think of this as being provided by Support for simplicity (not +// many clients are aware of their dependency on llvm-c). +// +//===----------------------------------------------------------------------===// + +#include "llvm-c/DataTypes.h" -- 2.7.4