Path: blob/main/contrib/llvm-project/compiler-rt/lib/fuzzer/FuzzerBuiltins.h
35262 views
//===- FuzzerBuiltins.h - Internal header for builtins ----------*- 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// Wrapper functions and marcos around builtin functions.8//===----------------------------------------------------------------------===//910#ifndef LLVM_FUZZER_BUILTINS_H11#define LLVM_FUZZER_BUILTINS_H1213#include "FuzzerPlatform.h"1415#if !LIBFUZZER_MSVC16#include <cstdint>1718#define GET_CALLER_PC() __builtin_return_address(0)1920namespace fuzzer {2122inline uint8_t Bswap(uint8_t x) { return x; }23inline uint16_t Bswap(uint16_t x) { return __builtin_bswap16(x); }24inline uint32_t Bswap(uint32_t x) { return __builtin_bswap32(x); }25inline uint64_t Bswap(uint64_t x) { return __builtin_bswap64(x); }2627inline uint32_t Clzll(unsigned long long X) { return __builtin_clzll(X); }28inline int Popcountll(unsigned long long X) { return __builtin_popcountll(X); }2930} // namespace fuzzer3132#endif // !LIBFUZZER_MSVC33#endif // LLVM_FUZZER_BUILTINS_H343536