Skip to content

Commit

Permalink
[libc][Obvious][NFC] A bunch of cosmetic cleanup.
Browse files Browse the repository at this point in the history
* Added missing header guards.
* Fixed license header format in a few files.
* Renamed files to more suitable names.
  • Loading branch information
Siva Chandra Reddy committed Nov 19, 2021
1 parent f3b7cc8 commit d9bbad2
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
5 changes: 5 additions & 0 deletions libc/fuzzing/math/RemQuoDiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_FUZZING_MATH_REMQUO_H
#define LLVM_LIBC_FUZZING_MATH_REMQUO_H

#include "src/__support/FPUtil/FPBits.h"

#include <math.h>
Expand Down Expand Up @@ -46,3 +49,5 @@ void RemQuoDiff(RemQuoFunc<T> func1, RemQuoFunc<T> func2, const uint8_t *data,
if (bits1.uintval() != bits2.uintval())
__builtin_trap();
}

#endif // LLVM_LIBC_FUZZING_MATH_REMQUO_H
4 changes: 2 additions & 2 deletions libc/fuzzing/stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ add_libc_fuzzer(
)

add_libc_fuzzer(
atof_fuzz
atof_differential_fuzz
SRCS
atof_fuzz.cpp
atof_differential_fuzz.cpp
HDRS
StringParserOutputDiff.h
DEPENDS
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions libc/include/sys/mman.h.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SYS_MMAN_H
#define LLVM_LIBC_SYS_MMAN_H

#include <__llvm-libc-common.h>

%%public_api()

#endif // LLVM_LIBC_SYS_MMAN_H
5 changes: 5 additions & 0 deletions libc/include/sys/syscall.h.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SYS_SYSCALL_H
#define LLVM_LIBC_SYS_SYSCALL_H

<!> If syscall.h were a linux only file, then we do not need this indirection.
<!> However, to keep the option of a non-linux OS requiring a syscall.h file,
<!> with its own special syscall numbers, we use this indirection.
%%include_file(${syscall_numbers})

#endif // LLVM_LIBC_SYS_SYSCALL_H
7 changes: 6 additions & 1 deletion libc/src/__support/architectures.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
//===-- Compile time architecture detection -------------------------------===//
//===-- Compile time architecture detection ---------------------*- 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_SUPPORT_ARCHITECTURES_H
#define LLVM_LIBC_SUPPORT_ARCHITECTURES_H

#if defined(__pnacl__) || defined(__CLR_VER)
#define LLVM_LIBC_ARCH_VM
#endif
Expand Down Expand Up @@ -33,3 +36,5 @@
#if (defined(LLVM_LIBC_ARCH_AARCH64) || defined(LLVM_LIBC_ARCH_ARM))
#define LLVM_LIBC_ARCH_ANY_ARM
#endif

#endif // LLVM_LIBC_SUPPORT_ARCHITECTURES_H
2 changes: 1 addition & 1 deletion libc/src/__support/common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- Common internal contructs -----------------------------------------===//
//===-- Common internal contructs -------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
2 changes: 1 addition & 1 deletion libc/src/__support/endian.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- Endianness support ------------------------------------------------===//
//===-- Endianness support --------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
2 changes: 1 addition & 1 deletion libc/src/__support/sanitizer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- Convenient sanitizer macros ---------------------------------------===//
//===-- Convenient sanitizer macros -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down

0 comments on commit d9bbad2

Please sign in to comment.