summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Fuzzer/FuzzerCorpus.h6
-rw-r--r--llvm/lib/Fuzzer/FuzzerCrossOver.cpp3
-rw-r--r--llvm/lib/Fuzzer/FuzzerDefs.h2
-rw-r--r--llvm/lib/Fuzzer/FuzzerDictionary.h1
-rw-r--r--llvm/lib/Fuzzer/FuzzerDriver.cpp1
-rw-r--r--llvm/lib/Fuzzer/FuzzerExtFunctions.h2
-rw-r--r--llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp2
-rw-r--r--llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp2
-rw-r--r--llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp2
-rw-r--r--llvm/lib/Fuzzer/FuzzerFnAdapter.h3
-rw-r--r--llvm/lib/Fuzzer/FuzzerIO.cpp3
-rw-r--r--llvm/lib/Fuzzer/FuzzerIO.h2
-rw-r--r--llvm/lib/Fuzzer/FuzzerIOPosix.cpp3
-rw-r--r--llvm/lib/Fuzzer/FuzzerIOWindows.cpp5
-rw-r--r--llvm/lib/Fuzzer/FuzzerInternal.h13
-rw-r--r--llvm/lib/Fuzzer/FuzzerLoop.cpp1
-rw-r--r--llvm/lib/Fuzzer/FuzzerSHA1.h2
-rw-r--r--llvm/lib/Fuzzer/FuzzerTracePC.h3
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtil.h2
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp5
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtilLinux.cpp7
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtilPosix.cpp4
-rw-r--r--llvm/lib/Fuzzer/FuzzerUtilWindows.cpp2
23 files changed, 48 insertions, 28 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerCorpus.h b/llvm/lib/Fuzzer/FuzzerCorpus.h
index bbe192f53f8..88e83b320c4 100644
--- a/llvm/lib/Fuzzer/FuzzerCorpus.h
+++ b/llvm/lib/Fuzzer/FuzzerCorpus.h
@@ -12,14 +12,14 @@
#ifndef LLVM_FUZZER_CORPUS
#define LLVM_FUZZER_CORPUS
-#include <random>
-#include <unordered_set>
-
#include "FuzzerDefs.h"
#include "FuzzerIO.h"
#include "FuzzerRandom.h"
#include "FuzzerSHA1.h"
#include "FuzzerTracePC.h"
+#include <numeric>
+#include <random>
+#include <unordered_set>
namespace fuzzer {
diff --git a/llvm/lib/Fuzzer/FuzzerCrossOver.cpp b/llvm/lib/Fuzzer/FuzzerCrossOver.cpp
index e86e23f81f0..8b0fd7d529a 100644
--- a/llvm/lib/Fuzzer/FuzzerCrossOver.cpp
+++ b/llvm/lib/Fuzzer/FuzzerCrossOver.cpp
@@ -9,11 +9,10 @@
// Cross over test inputs.
//===----------------------------------------------------------------------===//
-#include <cstring>
-
#include "FuzzerDefs.h"
#include "FuzzerMutate.h"
#include "FuzzerRandom.h"
+#include <cstring>
namespace fuzzer {
diff --git a/llvm/lib/Fuzzer/FuzzerDefs.h b/llvm/lib/Fuzzer/FuzzerDefs.h
index 89d675ac1a4..a699045842b 100644
--- a/llvm/lib/Fuzzer/FuzzerDefs.h
+++ b/llvm/lib/Fuzzer/FuzzerDefs.h
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// Basic definitions.
//===----------------------------------------------------------------------===//
+
#ifndef LLVM_FUZZER_DEFS_H
#define LLVM_FUZZER_DEFS_H
@@ -77,4 +78,5 @@ inline uint32_t Bswap(uint32_t x) { return __builtin_bswap32(x); }
inline uint64_t Bswap(uint64_t x) { return __builtin_bswap64(x); }
} // namespace fuzzer
+
#endif // LLVM_FUZZER_DEFS_H
diff --git a/llvm/lib/Fuzzer/FuzzerDictionary.h b/llvm/lib/Fuzzer/FuzzerDictionary.h
index b23b4b022e3..eba0eabb683 100644
--- a/llvm/lib/Fuzzer/FuzzerDictionary.h
+++ b/llvm/lib/Fuzzer/FuzzerDictionary.h
@@ -122,4 +122,3 @@ bool ParseDictionaryFile(const std::string &Text, std::vector<Unit> *Units);
} // namespace fuzzer
#endif // LLVM_FUZZER_DICTIONARY_H
-
diff --git a/llvm/lib/Fuzzer/FuzzerDriver.cpp b/llvm/lib/Fuzzer/FuzzerDriver.cpp
index f4f1a4d47d1..fb86cbc1efa 100644
--- a/llvm/lib/Fuzzer/FuzzerDriver.cpp
+++ b/llvm/lib/Fuzzer/FuzzerDriver.cpp
@@ -15,7 +15,6 @@
#include "FuzzerIO.h"
#include "FuzzerMutate.h"
#include "FuzzerRandom.h"
-
#include <algorithm>
#include <atomic>
#include <chrono>
diff --git a/llvm/lib/Fuzzer/FuzzerExtFunctions.h b/llvm/lib/Fuzzer/FuzzerExtFunctions.h
index 2ec86cb9231..2672a385478 100644
--- a/llvm/lib/Fuzzer/FuzzerExtFunctions.h
+++ b/llvm/lib/Fuzzer/FuzzerExtFunctions.h
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// Defines an interface to (possibly optional) functions.
//===----------------------------------------------------------------------===//
+
#ifndef LLVM_FUZZER_EXT_FUNCTIONS_H
#define LLVM_FUZZER_EXT_FUNCTIONS_H
@@ -30,4 +31,5 @@ struct ExternalFunctions {
#undef EXT_FUNC
};
} // namespace fuzzer
+
#endif
diff --git a/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp b/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp
index 65b0458dcee..06bddd5de38 100644
--- a/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp
+++ b/llvm/lib/Fuzzer/FuzzerExtFunctionsDlsym.cpp
@@ -46,5 +46,7 @@ ExternalFunctions::ExternalFunctions() {
#undef EXT_FUNC
}
+
} // namespace fuzzer
+
#endif // LIBFUZZER_APPLE
diff --git a/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp b/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp
index cb3b31105d5..7b02b6f0b70 100644
--- a/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp
+++ b/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp
@@ -47,5 +47,7 @@ ExternalFunctions::ExternalFunctions() {
#undef EXT_FUNC
}
+
} // namespace fuzzer
+
#endif // LIBFUZZER_LINUX
diff --git a/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp b/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp
index 3c42e539fcc..e10f7b4dcac 100644
--- a/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp
+++ b/llvm/lib/Fuzzer/FuzzerExtFunctionsWeakAlias.cpp
@@ -50,5 +50,7 @@ ExternalFunctions::ExternalFunctions() {
#undef EXT_FUNC
}
+
} // namespace fuzzer
+
#endif // LIBFUZZER_WINDOWS
diff --git a/llvm/lib/Fuzzer/FuzzerFnAdapter.h b/llvm/lib/Fuzzer/FuzzerFnAdapter.h
index eb2c219b870..e53b628ed21 100644
--- a/llvm/lib/Fuzzer/FuzzerFnAdapter.h
+++ b/llvm/lib/Fuzzer/FuzzerFnAdapter.h
@@ -15,10 +15,9 @@
#ifndef LLVM_FUZZER_ADAPTER_H
#define LLVM_FUZZER_ADAPTER_H
+#include <algorithm>
#include <stddef.h>
#include <stdint.h>
-
-#include <algorithm>
#include <string>
#include <tuple>
#include <vector>
diff --git a/llvm/lib/Fuzzer/FuzzerIO.cpp b/llvm/lib/Fuzzer/FuzzerIO.cpp
index 5d4d415d49e..eda8e877293 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIO.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// IO functions.
//===----------------------------------------------------------------------===//
+
#include "FuzzerIO.h"
#include "FuzzerDefs.h"
#include "FuzzerExtFunctions.h"
@@ -15,8 +16,8 @@
#include <cstdarg>
#include <fstream>
#include <iterator>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
namespace fuzzer {
diff --git a/llvm/lib/Fuzzer/FuzzerIO.h b/llvm/lib/Fuzzer/FuzzerIO.h
index 39634f93fec..f5651cfe9ed 100644
--- a/llvm/lib/Fuzzer/FuzzerIO.h
+++ b/llvm/lib/Fuzzer/FuzzerIO.h
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// IO interface.
//===----------------------------------------------------------------------===//
+
#ifndef LLVM_FUZZER_IO_H
#define LLVM_FUZZER_IO_H
@@ -59,4 +60,5 @@ int DuplicateFile(int Fd);
void DeleteFile(const std::string &Path);
} // namespace fuzzer
+
#endif // LLVM_FUZZER_IO_H
diff --git a/llvm/lib/Fuzzer/FuzzerIOPosix.cpp b/llvm/lib/Fuzzer/FuzzerIOPosix.cpp
index a4290face97..53a58f96287 100644
--- a/llvm/lib/Fuzzer/FuzzerIOPosix.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIOPosix.cpp
@@ -8,9 +8,9 @@
//===----------------------------------------------------------------------===//
// IO functions implementation using Posix API.
//===----------------------------------------------------------------------===//
-
#include "FuzzerDefs.h"
#if LIBFUZZER_POSIX
+
#include "FuzzerExtFunctions.h"
#include "FuzzerIO.h"
#include <cstdarg>
@@ -84,4 +84,5 @@ std::string DirName(const std::string &FileName) {
}
} // namespace fuzzer
+
#endif // LIBFUZZER_POSIX
diff --git a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
index aaa2e34fb35..df530cdfbbc 100644
--- a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
@@ -8,9 +8,9 @@
//===----------------------------------------------------------------------===//
// IO functions implementation for Windows.
//===----------------------------------------------------------------------===//
-
#include "FuzzerDefs.h"
#if LIBFUZZER_WINDOWS
+
#include "FuzzerExtFunctions.h"
#include "FuzzerIO.h"
#include <cstdarg>
@@ -18,8 +18,8 @@
#include <fstream>
#include <io.h>
#include <iterator>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <windows.h>
namespace fuzzer {
@@ -144,4 +144,5 @@ std::string DirName(const std::string &FileName) {
}
} // namespace fuzzer
+
#endif // LIBFUZZER_WINDOWS
diff --git a/llvm/lib/Fuzzer/FuzzerInternal.h b/llvm/lib/Fuzzer/FuzzerInternal.h
index e3a1801b467..f1e7415bb63 100644
--- a/llvm/lib/Fuzzer/FuzzerInternal.h
+++ b/llvm/lib/Fuzzer/FuzzerInternal.h
@@ -12,19 +12,18 @@
#ifndef LLVM_FUZZER_INTERNAL_H
#define LLVM_FUZZER_INTERNAL_H
-#include <algorithm>
-#include <atomic>
-#include <chrono>
-#include <climits>
-#include <cstdlib>
-#include <string.h>
-
#include "FuzzerDefs.h"
#include "FuzzerExtFunctions.h"
#include "FuzzerInterface.h"
#include "FuzzerOptions.h"
#include "FuzzerSHA1.h"
#include "FuzzerValueBitMap.h"
+#include <algorithm>
+#include <atomic>
+#include <chrono>
+#include <climits>
+#include <cstdlib>
+#include <string.h>
namespace fuzzer {
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp
index f96fc7416ff..93db6179e3d 100644
--- a/llvm/lib/Fuzzer/FuzzerLoop.cpp
+++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp
@@ -15,7 +15,6 @@
#include "FuzzerMutate.h"
#include "FuzzerRandom.h"
#include "FuzzerTracePC.h"
-
#include <algorithm>
#include <cstring>
#include <memory>
diff --git a/llvm/lib/Fuzzer/FuzzerSHA1.h b/llvm/lib/Fuzzer/FuzzerSHA1.h
index b3e6111b474..3b5e6e807f4 100644
--- a/llvm/lib/Fuzzer/FuzzerSHA1.h
+++ b/llvm/lib/Fuzzer/FuzzerSHA1.h
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// SHA1 utils.
//===----------------------------------------------------------------------===//
+
#ifndef LLVM_FUZZER_SHA1_H
#define LLVM_FUZZER_SHA1_H
@@ -28,4 +29,5 @@ std::string Sha1ToString(const uint8_t Sha1[kSHA1NumBytes]);
std::string Hash(const Unit &U);
} // namespace fuzzer
+
#endif // LLVM_FUZZER_SHA1_H
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.h b/llvm/lib/Fuzzer/FuzzerTracePC.h
index acff27fd9db..df037390c2a 100644
--- a/llvm/lib/Fuzzer/FuzzerTracePC.h
+++ b/llvm/lib/Fuzzer/FuzzerTracePC.h
@@ -12,10 +12,9 @@
#ifndef LLVM_FUZZER_TRACE_PC
#define LLVM_FUZZER_TRACE_PC
-#include <set>
-
#include "FuzzerDefs.h"
#include "FuzzerValueBitMap.h"
+#include <set>
namespace fuzzer {
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.h b/llvm/lib/Fuzzer/FuzzerUtil.h
index 78b7c2489b0..08058c56e4c 100644
--- a/llvm/lib/Fuzzer/FuzzerUtil.h
+++ b/llvm/lib/Fuzzer/FuzzerUtil.h
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
// Util functions.
//===----------------------------------------------------------------------===//
+
#ifndef LLVM_FUZZER_UTIL_H
#define LLVM_FUZZER_UTIL_H
@@ -67,4 +68,5 @@ inline std::string CloneArgsWithoutX(const std::vector<std::string> &Args,
}
} // namespace fuzzer
+
#endif // LLVM_FUZZER_UTIL_H
diff --git a/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp b/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp
index 62f0f2271fe..9674368c355 100644
--- a/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp
+++ b/llvm/lib/Fuzzer/FuzzerUtilDarwin.cpp
@@ -10,6 +10,7 @@
//===----------------------------------------------------------------------===//
#include "FuzzerDefs.h"
#if LIBFUZZER_APPLE
+
#include "FuzzerIO.h"
#include <mutex>
#include <signal.h>
@@ -145,5 +146,7 @@ int ExecuteCommand(const std::string &Command) {
}
return ProcessStatus;
}
-}
+
+} // namespace fuzzer
+
#endif // LIBFUZZER_APPLE
diff --git a/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp b/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp
index 060cec04542..dfe7e6f4e18 100644
--- a/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp
+++ b/llvm/lib/Fuzzer/FuzzerUtilLinux.cpp
@@ -10,10 +10,15 @@
//===----------------------------------------------------------------------===//
#include "FuzzerDefs.h"
#if LIBFUZZER_LINUX
+
#include <stdlib.h>
+
namespace fuzzer {
+
int ExecuteCommand(const std::string &Command) {
return system(Command.c_str());
}
-}
+
+} // namespace fuzzer
+
#endif // LIBFUZZER_LINUX
diff --git a/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp b/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp
index fc058cd7260..8b484b8effa 100644
--- a/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp
+++ b/llvm/lib/Fuzzer/FuzzerUtilPosix.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// Misc utils implementation using Posix API.
//===----------------------------------------------------------------------===//
-
#include "FuzzerDefs.h"
#if LIBFUZZER_POSIX
#include "FuzzerIO.h"
@@ -113,5 +112,6 @@ const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt,
return memmem(Data, DataLen, Patt, PattLen);
}
-} // namespace fuzzer
+} // namespace fuzzer
+
#endif // LIBFUZZER_POSIX
diff --git a/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp b/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp
index 91509cce8b5..fea09a698b5 100644
--- a/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp
+++ b/llvm/lib/Fuzzer/FuzzerUtilWindows.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// Misc utils implementation for Windows.
//===----------------------------------------------------------------------===//
-
#include "FuzzerDefs.h"
#if LIBFUZZER_WINDOWS
#include "FuzzerIO.h"
@@ -179,4 +178,5 @@ const void *SearchMemory(const void *Data, size_t DataLen, const void *Patt,
}
} // namespace fuzzer
+
#endif // LIBFUZZER_WINDOWS
OpenPOWER on IntegriCloud