mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 19:08:21 +08:00
[libc] Rearrange error and signal tables.
This is largely a cosmetic change done with a few goals: 1. Reduce the conditionals in picking the correct set of tables for the platform. 2. Avoid exposing, for example Linux errors, when building for non-Linux platforms. This also prevents build failures when Linux errors are not defined on the target non-Linux platform. 3. Some "_table" suffixes have been removed to avoid repeated occurance of "table" like "tables/linux_error_table.h". Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D151367
This commit is contained in:
@@ -3,6 +3,7 @@ add_header_library(
|
||||
HDRS
|
||||
message_mapper.h
|
||||
DEPENDS
|
||||
libc.src.__support.CPP.array
|
||||
libc.src.__support.CPP.string_view
|
||||
libc.src.__support.CPP.optional
|
||||
)
|
||||
@@ -10,6 +11,30 @@ add_header_library(
|
||||
# The table maps depend on message_mapper.
|
||||
add_subdirectory(tables)
|
||||
|
||||
add_header_library(
|
||||
platform_errors
|
||||
HDRS
|
||||
platform_errors.h
|
||||
DEPENDS
|
||||
# To avoid complicated conditionals, we will unconditionally add dependency
|
||||
# on all platform errors which are included in platform_error_table.h.
|
||||
# Ultimately, only the relevent error table will be used.
|
||||
.tables.linux_platform_errors
|
||||
.tables.minimal_platform_errors
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
platform_signals
|
||||
HDRS
|
||||
platform_signals.h
|
||||
DEPENDS
|
||||
# To avoid complicated conditionals, we will unconditionally add dependency
|
||||
# on all platform signals which are included in platform_signal_table.h.
|
||||
# Ultimately, only the relevent signal table will be used.
|
||||
.tables.linux_platform_signals
|
||||
.tables.minimal_platform_signals
|
||||
)
|
||||
|
||||
add_object_library(
|
||||
error_to_string
|
||||
HDRS
|
||||
@@ -18,12 +43,11 @@ add_object_library(
|
||||
error_to_string.cpp
|
||||
DEPENDS
|
||||
.message_mapper
|
||||
libc.src.errno.errno
|
||||
.platform_errors
|
||||
libc.src.__support.CPP.span
|
||||
libc.src.__support.CPP.string_view
|
||||
libc.src.__support.CPP.stringstream
|
||||
libc.src.__support.integer_to_string
|
||||
libc.src.__support.StringUtil.tables.error_table
|
||||
)
|
||||
|
||||
add_object_library(
|
||||
@@ -34,10 +58,10 @@ add_object_library(
|
||||
signal_to_string.cpp
|
||||
DEPENDS
|
||||
.message_mapper
|
||||
.platform_signals
|
||||
libc.include.signal
|
||||
libc.src.__support.CPP.span
|
||||
libc.src.__support.CPP.string_view
|
||||
libc.src.__support.CPP.stringstream
|
||||
libc.src.__support.integer_to_string
|
||||
libc.src.__support.StringUtil.tables.signal_table
|
||||
)
|
||||
|
||||
@@ -6,19 +6,15 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/StringUtil/error_to_string.h"
|
||||
#include "error_to_string.h"
|
||||
#include "platform_errors.h"
|
||||
|
||||
#include "src/errno/libc_errno.h" // For error macros
|
||||
|
||||
#include "src/__support/CPP/array.h"
|
||||
#include "src/__support/CPP/span.h"
|
||||
#include "src/__support/CPP/string_view.h"
|
||||
#include "src/__support/CPP/stringstream.h"
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
#include "src/__support/integer_to_string.h"
|
||||
|
||||
#include "src/__support/StringUtil/tables/error_table.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <stddef.h>
|
||||
|
||||
namespace __llvm_libc {
|
||||
namespace internal {
|
||||
|
||||
struct MsgMapping {
|
||||
int num;
|
||||
@@ -99,7 +98,6 @@ constexpr MsgTable<N1 + N2> operator+(const MsgTable<N1> &t1,
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_MESSAGE_MAPPER_H
|
||||
|
||||
18
libc/src/__support/StringUtil/platform_errors.h
Normal file
18
libc/src/__support/StringUtil/platform_errors.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//===-- The error table for the current platform ----------------*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_PLATFORM_ERROR_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_PLATFORM_ERROR_TABLE_H
|
||||
|
||||
#if defined(__linux__) || defined(__Fuchsia__)
|
||||
#include "tables/linux_platform_errors.h"
|
||||
#else
|
||||
#include "tables/minimal_platform_errors.h"
|
||||
#endif
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_PLATFORM_ERROR_TABLE_H
|
||||
18
libc/src/__support/StringUtil/platform_signals.h
Normal file
18
libc/src/__support/StringUtil/platform_signals.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//===-- The signal table for the current platform ---------------*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_PLATFORM_SIGNAL_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_PLATFORM_SIGNAL_TABLE_H
|
||||
|
||||
#if defined(__linux__) || defined(__Fuchsia__)
|
||||
#include "tables/linux_platform_signals.h"
|
||||
#else
|
||||
#include "tables/minimal_platform_signals.h"
|
||||
#endif
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_PLATFORM_SIGNAL_TABLE_H
|
||||
@@ -6,13 +6,13 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "src/__support/StringUtil/signal_to_string.h"
|
||||
#include "signal_to_string.h"
|
||||
#include "platform_signals.h"
|
||||
|
||||
#include "src/__support/CPP/span.h"
|
||||
#include "src/__support/CPP/string_view.h"
|
||||
#include "src/__support/CPP/stringstream.h"
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
#include "src/__support/StringUtil/tables/signal_table.h"
|
||||
#include "src/__support/integer_to_string.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
@@ -1,35 +1,89 @@
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
|
||||
add_subdirectory(${LIBC_TARGET_OS})
|
||||
endif()
|
||||
|
||||
set(error_to_string_platform_dep "")
|
||||
if(TARGET libc.src.__support.StringUtil.tables.${LIBC_TARGET_OS}.error_table)
|
||||
set(error_to_string_platform_dep
|
||||
libc.src.__support.StringUtil.tables.${LIBC_TARGET_OS}.error_table)
|
||||
endif()
|
||||
|
||||
add_header_library(
|
||||
error_table
|
||||
stdc_errors
|
||||
HDRS
|
||||
error_table.h
|
||||
stdc_error_table.h
|
||||
posix_error_table.h
|
||||
stdc_errors.h
|
||||
DEPENDS
|
||||
${error_to_string_platform_dep}
|
||||
libc.include.errno
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
)
|
||||
|
||||
set(signal_to_string_platform_dep "")
|
||||
if(TARGET libc.src.__support.StringUtil.tables.${LIBC_TARGET_OS}.signal_table)
|
||||
set(signal_to_string_platform_dep
|
||||
libc.src.__support.StringUtil.tables.${LIBC_TARGET_OS}.signal_table)
|
||||
endif()
|
||||
add_header_library(
|
||||
posix_errors
|
||||
HDRS
|
||||
posix_errors.h
|
||||
DEPENDS
|
||||
libc.include.errno
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
signal_table
|
||||
linux_extension_errors
|
||||
HDRS
|
||||
signal_table.h
|
||||
stdc_signal_table.h
|
||||
posix_signal_table.h
|
||||
linux_extension_errors.h
|
||||
DEPENDS
|
||||
${signal_to_string_platform_dep}
|
||||
libc.include.errno
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
linux_platform_errors
|
||||
HDRS
|
||||
linux_platform_errors
|
||||
DEPENDS
|
||||
.linux_extension_errors
|
||||
.posix_errors
|
||||
.stdc_errors
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
minimal_platform_errors
|
||||
HDRS
|
||||
minimal_platform_errors
|
||||
DEPENDS
|
||||
.stdc_errors
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
stdc_signals
|
||||
HDRS
|
||||
stdc_signals.h
|
||||
DEPENDS
|
||||
libc.include.signal
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
posix_signals
|
||||
HDRS
|
||||
posix_signals.h
|
||||
DEPENDS
|
||||
libc.include.signal
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
linux_extension_signals
|
||||
HDRS
|
||||
linux_extension_signals.h
|
||||
DEPENDS
|
||||
libc.include.signal
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
linux_platform_signals
|
||||
HDRS
|
||||
linux_platform_signals
|
||||
DEPENDS
|
||||
.linux_extension_signals
|
||||
.posix_signals
|
||||
.stdc_signals
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
minimal_platform_signals
|
||||
HDRS
|
||||
minimal_platform_signals
|
||||
DEPENDS
|
||||
.stdc_signals
|
||||
)
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
//===-- Map from error numbers to strings -----------------------*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_ERROR_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_ERROR_TABLE_H
|
||||
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
#include "posix_error_table.h"
|
||||
#include "stdc_error_table.h"
|
||||
|
||||
#if defined(__linux__) || defined(__Fuchsia__)
|
||||
#define USE_LINUX_PLATFORM_ERRORS 1
|
||||
#else
|
||||
#define USE_LINUX_PLATFORM_ERRORS 0
|
||||
#endif
|
||||
|
||||
#if USE_LINUX_PLATFORM_ERRORS
|
||||
#include "linux/error_table.h"
|
||||
#endif
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
|
||||
inline constexpr auto PLATFORM_ERRORS = []() {
|
||||
if constexpr (USE_LINUX_PLATFORM_ERRORS) {
|
||||
return STDC_ERRORS + POSIX_ERRORS + LINUX_ERRORS;
|
||||
} else {
|
||||
return STDC_ERRORS;
|
||||
}
|
||||
}();
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_ERROR_TABLE_H
|
||||
@@ -1,17 +0,0 @@
|
||||
add_header_library(
|
||||
error_table
|
||||
HDRS
|
||||
error_table.h
|
||||
DEPENDS
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
libc.src.errno.errno
|
||||
)
|
||||
|
||||
add_header_library(
|
||||
signal_table
|
||||
HDRS
|
||||
signal_table.h
|
||||
DEPENDS
|
||||
libc.src.__support.StringUtil.message_mapper
|
||||
libc.include.signal
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- Map from error numbers to strings on linux --------------*- C++ -*-===//
|
||||
//===-- Map of Linux extension error numbers to strings ---------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERROR_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERROR_TABLE_H
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_EXTENSION_ERRORS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_EXTENSION_ERRORS_H
|
||||
|
||||
#include "src/errno/libc_errno.h" // For error macros
|
||||
|
||||
#include "src/__support/CPP/array.h"
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
#include <errno.h> // For error macros
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
constexpr MsgTable<52> LINUX_ERRORS = {
|
||||
MsgMapping(ENOTBLK, "Block device required"),
|
||||
@@ -71,6 +70,6 @@ constexpr MsgTable<52> LINUX_ERRORS = {
|
||||
MsgMapping(EHWPOISON, "Memory page has hardware error"),
|
||||
};
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERROR_TABLE_H
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_EXTENSION_ERRORS_H
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- Map from signal numbers to strings on linux -------------*- C++ -*-===//
|
||||
//===-- Map of Linux extension signal numbers to strings --------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,14 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNAL_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNAL_TABLE_H
|
||||
|
||||
#include <signal.h>
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_EXTENSION_SIGNALS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_EXTENSION_SIGNALS_H
|
||||
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
#include <signal.h> // For signal numbers
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
// The array being larger than necessary isn't a problem. The MsgMappings will
|
||||
// be set to their default state which maps 0 to an empty string. This will get
|
||||
@@ -28,6 +28,6 @@ inline constexpr const MsgTable<3> LINUX_SIGNALS = {
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNAL_TABLE_H
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_EXTENSION_SIGNALS_H
|
||||
23
libc/src/__support/StringUtil/tables/linux_platform_errors.h
Normal file
23
libc/src/__support/StringUtil/tables/linux_platform_errors.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//===-- Map of error numbers to strings for the Linux platform --*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_ERRORS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_ERRORS_H
|
||||
|
||||
#include "linux_extension_errors.h"
|
||||
#include "posix_errors.h"
|
||||
#include "stdc_errors.h"
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr auto PLATFORM_ERRORS =
|
||||
STDC_ERRORS + POSIX_ERRORS + LINUX_ERRORS;
|
||||
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_ERRORS_H
|
||||
@@ -0,0 +1,23 @@
|
||||
//===-- Map of error numbers to strings for the Linux platform --*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_SIGNALS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_SIGNALS_H
|
||||
|
||||
#include "linux_extension_signals.h"
|
||||
#include "posix_signals.h"
|
||||
#include "stdc_signals.h"
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr auto PLATFORM_SIGNALS =
|
||||
STDC_SIGNALS + POSIX_SIGNALS + LINUX_SIGNALS;
|
||||
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_PLATFORM_SIGNALS_H
|
||||
@@ -0,0 +1,20 @@
|
||||
//===-- Map of error numbers to strings for a stdc platform -----*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_ERRORS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_ERRORS_H
|
||||
|
||||
#include "stdc_errors.h"
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr auto PLATFORM_ERRORS = STDC_ERRORS;
|
||||
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_ERRORS_H
|
||||
@@ -0,0 +1,20 @@
|
||||
//===-- Map of error numbers to strings for a stdc platform -----*- 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 LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_SIGNALS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_SIGNALS_H
|
||||
|
||||
#include "stdc_signals.h"
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr auto PLATFORM_SIGNALS = STDC_SIGNALS;
|
||||
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_MINIMAL_PLATFORM_SIGNALS_H
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- Map from error numbers to strings in posix --------------*- C++ -*-===//
|
||||
//===-- Map of POSIX error numbers to strings -------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERROR_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERROR_TABLE_H
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERRORS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERRORS_H
|
||||
|
||||
#include "src/errno/libc_errno.h" // For error macros
|
||||
|
||||
#include "src/__support/CPP/array.h"
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
#include <errno.h> // For error macros
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr MsgTable<76> POSIX_ERRORS = {
|
||||
MsgMapping(EPERM, "Operation not permitted"),
|
||||
@@ -95,6 +94,6 @@ inline constexpr MsgTable<76> POSIX_ERRORS = {
|
||||
MsgMapping(ENOTRECOVERABLE, "State not recoverable"),
|
||||
};
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERROR_TABLE_H
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_ERRORS_H
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- Map from signal numbers to strings in posix -------------*- C++ -*-===//
|
||||
//===-- Map of POSIX signal numbers to strings ------------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,15 +6,15 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNAL_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNAL_TABLE_H
|
||||
|
||||
#include <signal.h>
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNALS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNALS_H
|
||||
|
||||
#include "src/__support/CPP/array.h"
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
#include <signal.h> // For signal numbers
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr MsgTable<22> POSIX_SIGNALS = {
|
||||
MsgMapping(SIGHUP, "Hangup"),
|
||||
@@ -41,6 +41,6 @@ inline constexpr MsgTable<22> POSIX_SIGNALS = {
|
||||
MsgMapping(SIGSYS, "Bad system call"),
|
||||
};
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNAL_TABLE_H
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_POSIX_SIGNALS_H
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- Map from error numbers to strings in the c std ----------*- C++ -*-===//
|
||||
//===-- Map of C standard error numbers to strings --------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,14 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERROR_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERROR_TABLE_H
|
||||
|
||||
#include "src/errno/libc_errno.h" // For error macros
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERRORS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_ERRORS_H
|
||||
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
#include <errno.h> // For error macros
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr const MsgTable<4> STDC_ERRORS = {
|
||||
MsgMapping(0, "Success"),
|
||||
@@ -22,6 +22,6 @@ inline constexpr const MsgTable<4> STDC_ERRORS = {
|
||||
MsgMapping(EILSEQ, "Invalid or incomplete multibyte or wide character"),
|
||||
};
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERROR_TABLE_H
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_ERRORS_H
|
||||
@@ -1,4 +1,4 @@
|
||||
//===-- Map from signal numbers to strings in the c std ---------*- C++ -*-===//
|
||||
//===-- Map of C standard signal numbers to strings -------------*- C++ -*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
@@ -6,14 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNAL_TABLE_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNAL_TABLE_H
|
||||
#ifndef LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNALS_H
|
||||
#define LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_STDC_SIGNALS_H
|
||||
|
||||
#include <signal.h>
|
||||
#include <signal.h> // For signal numbers
|
||||
|
||||
#include "src/__support/StringUtil/message_mapper.h"
|
||||
|
||||
namespace __llvm_libc::internal {
|
||||
namespace __llvm_libc {
|
||||
|
||||
inline constexpr const MsgTable<6> STDC_SIGNALS = {
|
||||
MsgMapping(SIGINT, "Interrupt"),
|
||||
@@ -24,6 +24,6 @@ inline constexpr const MsgTable<6> STDC_SIGNALS = {
|
||||
MsgMapping(SIGTERM, "Terminated"),
|
||||
};
|
||||
|
||||
} // namespace __llvm_libc::internal
|
||||
} // namespace __llvm_libc
|
||||
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNAL_TABLE_H
|
||||
#endif // LLVM_LIBC_SRC_SUPPORT_STRING_UTIL_TABLES_LINUX_SIGNALS_H
|
||||
Reference in New Issue
Block a user