Path: blob/main/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model/cpu_model.h
35292 views
//===-- cpu_model_common.c - Utilities for cpu model detection ----*- C -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file implements common utilities for runtime cpu model detection.9//10//===----------------------------------------------------------------------===//1112#ifndef COMPILER_RT_LIB_BUILTINS_CPU_MODEL_COMMON_H13#define COMPILER_RT_LIB_BUILTINS_CPU_MODEL_COMMON_H1415#define bool int16#define true 117#define false 01819#ifndef __has_attribute20#define __has_attribute(attr) 021#endif2223#if __has_attribute(constructor)24#if __GNUC__ >= 925// Ordinarily init priorities below 101 are disallowed as they are reserved for26// the implementation. However, we are the implementation, so silence the27// diagnostic, since it doesn't apply to us.28#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"29#endif30// We're choosing init priority 90 to force our constructors to run before any31// constructors in the end user application (starting at priority 101). This32// value matches the libgcc choice for the same functions.33#define CONSTRUCTOR_ATTRIBUTE __attribute__((constructor(90)))34#else35// FIXME: For MSVC, we should make a function pointer global in .CRT$X?? so that36// this runs during initialization.37#define CONSTRUCTOR_ATTRIBUTE38#endif3940#endif414243