003 File Manager
Current Path:
/usr/src/contrib/llvm-project/compiler-rt/lib/fuzzer
usr
/
src
/
contrib
/
llvm-project
/
compiler-rt
/
lib
/
fuzzer
/
📁
..
📄
FuzzerBuiltins.h
(1.25 KB)
📄
FuzzerBuiltinsMsvc.h
(2.33 KB)
📄
FuzzerCommand.h
(5.95 KB)
📄
FuzzerCorpus.h
(16.93 KB)
📄
FuzzerCrossOver.cpp
(1.85 KB)
📄
FuzzerDataFlowTrace.cpp
(9.93 KB)
📄
FuzzerDataFlowTrace.h
(3.98 KB)
📄
FuzzerDefs.h
(1.99 KB)
📄
FuzzerDictionary.h
(3.32 KB)
📄
FuzzerDriver.cpp
(28.35 KB)
📄
FuzzerExtFunctions.def
(2.5 KB)
📄
FuzzerExtFunctions.h
(1.04 KB)
📄
FuzzerExtFunctionsDlsym.cpp
(1.63 KB)
📄
FuzzerExtFunctionsWeak.cpp
(1.9 KB)
📄
FuzzerExtFunctionsWindows.cpp
(2.79 KB)
📄
FuzzerExtraCounters.cpp
(1.55 KB)
📄
FuzzerFlags.def
(10.02 KB)
📄
FuzzerFork.cpp
(12.53 KB)
📄
FuzzerFork.h
(778 B)
📄
FuzzerIO.cpp
(4.47 KB)
📄
FuzzerIO.h
(3.31 KB)
📄
FuzzerIOPosix.cpp
(4.47 KB)
📄
FuzzerIOWindows.cpp
(11.59 KB)
📄
FuzzerInterface.h
(3.03 KB)
📄
FuzzerInternal.h
(5.33 KB)
📄
FuzzerLoop.cpp
(28.54 KB)
📄
FuzzerMain.cpp
(791 B)
📄
FuzzerMerge.cpp
(13.75 KB)
📄
FuzzerMerge.h
(3.31 KB)
📄
FuzzerMutate.cpp
(20.02 KB)
📄
FuzzerMutate.h
(6.57 KB)
📄
FuzzerOptions.h
(2.36 KB)
📄
FuzzerPlatform.h
(4.69 KB)
📄
FuzzerRandom.h
(1.21 KB)
📄
FuzzerSHA1.cpp
(5.56 KB)
📄
FuzzerSHA1.h
(978 B)
📄
FuzzerTracePC.cpp
(22.56 KB)
📄
FuzzerTracePC.h
(8.87 KB)
📄
FuzzerUtil.cpp
(6.75 KB)
📄
FuzzerUtil.h
(3.25 KB)
📄
FuzzerUtilDarwin.cpp
(5.87 KB)
📄
FuzzerUtilFuchsia.cpp
(20.16 KB)
📄
FuzzerUtilLinux.cpp
(1.12 KB)
📄
FuzzerUtilPosix.cpp
(5.07 KB)
📄
FuzzerUtilWindows.cpp
(5.93 KB)
📄
FuzzerValueBitMap.h
(2.24 KB)
📄
README.txt
(40 B)
Editing: FuzzerBuiltinsMsvc.h
//===- FuzzerBuiltinsMSVC.h - Internal header for builtins ------*- 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 // //===----------------------------------------------------------------------===// // Wrapper functions and marcos that use intrinsics instead of builtin functions // which cannot be compiled by MSVC. //===----------------------------------------------------------------------===// #ifndef LLVM_FUZZER_BUILTINS_MSVC_H #define LLVM_FUZZER_BUILTINS_MSVC_H #include "FuzzerPlatform.h" #if LIBFUZZER_MSVC #include <intrin.h> #include <cstdint> #include <cstdlib> // __builtin_return_address() cannot be compiled with MSVC. Use the equivalent // from <intrin.h> #define GET_CALLER_PC() _ReturnAddress() namespace fuzzer { inline uint8_t Bswap(uint8_t x) { return x; } // Use alternatives to __builtin functions from <stdlib.h> and <intrin.h> on // Windows since the builtins are not supported by MSVC. inline uint16_t Bswap(uint16_t x) { return _byteswap_ushort(x); } inline uint32_t Bswap(uint32_t x) { return _byteswap_ulong(x); } inline uint64_t Bswap(uint64_t x) { return _byteswap_uint64(x); } // The functions below were mostly copied from // compiler-rt/lib/builtins/int_lib.h which defines the __builtin functions used // outside of Windows. inline uint32_t Clzll(uint64_t X) { unsigned long LeadZeroIdx = 0; #if !defined(_M_ARM) && !defined(_M_X64) // Scan the high 32 bits. if (_BitScanReverse(&LeadZeroIdx, static_cast<unsigned long>(X >> 32))) return static_cast<int>(63 - (LeadZeroIdx + 32)); // Create a bit offset from the MSB. // Scan the low 32 bits. if (_BitScanReverse(&LeadZeroIdx, static_cast<unsigned long>(X))) return static_cast<int>(63 - LeadZeroIdx); #else if (_BitScanReverse64(&LeadZeroIdx, X)) return 63 - LeadZeroIdx; #endif return 64; } inline uint32_t Clz(uint32_t X) { unsigned long LeadZeroIdx = 0; if (_BitScanReverse(&LeadZeroIdx, X)) return 31 - LeadZeroIdx; return 32; } inline int Popcountll(unsigned long long X) { #if !defined(_M_ARM) && !defined(_M_X64) return __popcnt(X) + __popcnt(X >> 32); #else return __popcnt64(X); #endif } } // namespace fuzzer #endif // LIBFUZER_MSVC #endif // LLVM_FUZZER_BUILTINS_MSVC_H
Upload File
Create Folder