[llvm] [Support] Add clang tooling generated explicit visibility macros (PR #113097)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 20 10:56:53 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 8673d0e0673dd1a5e6f7a5df7509c45e33582987 9422085f30f8062b9caee6f0a3940034992f0067 --extensions h,cpp -- llvm/include/llvm/Support/AMDGPUMetadata.h llvm/include/llvm/Support/ARMAttributeParser.h llvm/include/llvm/Support/ARMBuildAttributes.h llvm/include/llvm/Support/ARMWinEH.h llvm/include/llvm/Support/Allocator.h llvm/include/llvm/Support/Atomic.h llvm/include/llvm/Support/BalancedPartitioning.h llvm/include/llvm/Support/Base64.h llvm/include/llvm/Support/BinaryStream.h llvm/include/llvm/Support/BinaryStreamError.h llvm/include/llvm/Support/BinaryStreamReader.h llvm/include/llvm/Support/BinaryStreamRef.h llvm/include/llvm/Support/BinaryStreamWriter.h llvm/include/llvm/Support/BlockFrequency.h llvm/include/llvm/Support/BranchProbability.h llvm/include/llvm/Support/BuryPointer.h llvm/include/llvm/Support/COM.h llvm/include/llvm/Support/CRC.h llvm/include/llvm/Support/CSKYAttributeParser.h llvm/include/llvm/Support/CSKYAttributes.h llvm/include/llvm/Support/CachePruning.h llvm/include/llvm/Support/Caching.h llvm/include/llvm/Support/Chrono.h llvm/include/llvm/Support/CodeGenCoverage.h llvm/include/llvm/Support/CommandLine.h llvm/include/llvm/Support/Compression.h llvm/include/llvm/Support/ConvertEBCDIC.h llvm/include/llvm/Support/ConvertUTF.h llvm/include/llvm/Support/CrashRecoveryContext.h llvm/include/llvm/Support/DJB.h llvm/include/llvm/Support/DataExtractor.h llvm/include/llvm/Support/Debug.h llvm/include/llvm/Support/DebugCounter.h llvm/include/llvm/Support/DivisionByConstantInfo.h llvm/include/llvm/Support/DynamicLibrary.h llvm/include/llvm/Support/ELFAttributeParser.h llvm/include/llvm/Support/ELFAttributes.h llvm/include/llvm/Support/Errno.h llvm/include/llvm/Support/Error.h llvm/include/llvm/Support/ErrorHandling.h llvm/include/llvm/Support/ExponentialBackoff.h llvm/include/llvm/Support/ExtensibleRTTI.h llvm/include/llvm/Support/FileCollector.h llvm/include/llvm/Support/FileOutputBuffer.h llvm/include/llvm/Support/FileSystem.h llvm/include/llvm/Support/FileUtilities.h llvm/include/llvm/Support/Format.h llvm/include/llvm/Support/FormatVariadic.h llvm/include/llvm/Support/FormatVariadicDetails.h llvm/include/llvm/Support/FormattedStream.h llvm/include/llvm/Support/GlobPattern.h llvm/include/llvm/Support/GraphWriter.h llvm/include/llvm/Support/HexagonAttributeParser.h llvm/include/llvm/Support/HexagonAttributes.h llvm/include/llvm/Support/InitLLVM.h llvm/include/llvm/Support/InstructionCost.h llvm/include/llvm/Support/JSON.h llvm/include/llvm/Support/KnownBits.h llvm/include/llvm/Support/LEB128.h llvm/include/llvm/Support/LineIterator.h llvm/include/llvm/Support/Locale.h llvm/include/llvm/Support/LockFileManager.h llvm/include/llvm/Support/MD5.h llvm/include/llvm/Support/MSP430AttributeParser.h llvm/include/llvm/Support/MSP430Attributes.h llvm/include/llvm/Support/ManagedStatic.h llvm/include/llvm/Support/MathExtras.h llvm/include/llvm/Support/MemAlloc.h llvm/include/llvm/Support/Memory.h llvm/include/llvm/Support/MemoryBuffer.h llvm/include/llvm/Support/MemoryBufferRef.h llvm/include/llvm/Support/ModRef.h llvm/include/llvm/Support/NativeFormatting.h llvm/include/llvm/Support/OptimizedStructLayout.h llvm/include/llvm/Support/OptionStrCmp.h llvm/include/llvm/Support/PGOOptions.h llvm/include/llvm/Support/Parallel.h llvm/include/llvm/Support/Path.h llvm/include/llvm/Support/PluginLoader.h llvm/include/llvm/Support/PrettyStackTrace.h llvm/include/llvm/Support/Process.h llvm/include/llvm/Support/Program.h llvm/include/llvm/Support/RISCVAttributeParser.h llvm/include/llvm/Support/RISCVAttributes.h llvm/include/llvm/Support/RISCVISAUtils.h llvm/include/llvm/Support/RandomNumberGenerator.h llvm/include/llvm/Support/Recycler.h llvm/include/llvm/Support/Regex.h llvm/include/llvm/Support/SHA1.h llvm/include/llvm/Support/SHA256.h llvm/include/llvm/Support/SMTAPI.h llvm/include/llvm/Support/ScaledNumber.h llvm/include/llvm/Support/ScopedPrinter.h llvm/include/llvm/Support/Signals.h llvm/include/llvm/Support/Signposts.h llvm/include/llvm/Support/SipHash.h llvm/include/llvm/Support/SmallVectorMemoryBuffer.h llvm/include/llvm/Support/SourceMgr.h llvm/include/llvm/Support/SpecialCaseList.h llvm/include/llvm/Support/StringSaver.h llvm/include/llvm/Support/SuffixTree.h llvm/include/llvm/Support/SuffixTreeNode.h llvm/include/llvm/Support/SystemUtils.h llvm/include/llvm/Support/TarWriter.h llvm/include/llvm/Support/ThreadPool.h llvm/include/llvm/Support/Threading.h llvm/include/llvm/Support/TimeProfiler.h llvm/include/llvm/Support/Timer.h llvm/include/llvm/Support/ToolOutputFile.h llvm/include/llvm/Support/TypeSize.h llvm/include/llvm/Support/Unicode.h llvm/include/llvm/Support/Valgrind.h llvm/include/llvm/Support/VersionTuple.h llvm/include/llvm/Support/VirtualFileSystem.h llvm/include/llvm/Support/Watchdog.h llvm/include/llvm/Support/Windows/WindowsSupport.h llvm/include/llvm/Support/WindowsError.h llvm/include/llvm/Support/WithColor.h llvm/include/llvm/Support/YAMLParser.h llvm/include/llvm/Support/YAMLTraits.h llvm/include/llvm/Support/circular_raw_ostream.h llvm/include/llvm/Support/raw_os_ostream.h llvm/include/llvm/Support/raw_ostream.h llvm/include/llvm/Support/raw_socket_stream.h llvm/include/llvm/Support/thread.h llvm/include/llvm/Support/xxhash.h llvm/lib/Support/CommandLine.cpp llvm/lib/Support/Debug.cpp llvm/lib/Support/SmallVector.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Support/ARMWinEH.h b/llvm/include/llvm/Support/ARMWinEH.h
index 3c952bcae5..083bbf405a 100644
--- a/llvm/include/llvm/Support/ARMWinEH.h
+++ b/llvm/include/llvm/Support/ARMWinEH.h
@@ -206,8 +206,8 @@ inline uint16_t StackAdjustment(const RuntimeFunction &RF) {
/// SavedRegisterMask - Utility function to calculate the set of saved general
/// purpose (r0-r15) and VFP (d0-d31) registers.
-LLVM_ABI std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
- bool Prologue = true);
+LLVM_ABI std::pair<uint16_t, uint32_t>
+SavedRegisterMask(const RuntimeFunction &RF, bool Prologue = true);
/// RuntimeFunctionARM64 - An entry in the table of procedure data (.pdata)
///
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index 36561cf5d5..59934190a5 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -36,8 +36,9 @@ namespace detail {
// We call out to an external function to actually print the message as the
// printing code uses Allocator.h in its implementation.
-LLVM_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
- size_t TotalMemory);
+LLVM_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs,
+ size_t BytesAllocated,
+ size_t TotalMemory);
} // end namespace detail
diff --git a/llvm/include/llvm/Support/Atomic.h b/llvm/include/llvm/Support/Atomic.h
index 43df01462b..c2d9ae2da2 100644
--- a/llvm/include/llvm/Support/Atomic.h
+++ b/llvm/include/llvm/Support/Atomic.h
@@ -27,16 +27,15 @@
namespace llvm {
namespace sys {
- LLVM_ABI void MemoryFence();
+ LLVM_ABI void MemoryFence();
#ifdef _MSC_VER
- typedef long cas_flag;
+ typedef long cas_flag;
#else
- typedef uint32_t cas_flag;
+ typedef uint32_t cas_flag;
#endif
- LLVM_ABI cas_flag CompareAndSwap(volatile cas_flag* ptr,
- cas_flag new_value,
- cas_flag old_value);
+ LLVM_ABI cas_flag CompareAndSwap(volatile cas_flag *ptr, cas_flag new_value,
+ cas_flag old_value);
}
}
diff --git a/llvm/include/llvm/Support/Base64.h b/llvm/include/llvm/Support/Base64.h
index 997e8c0b71..0dbd87b378 100644
--- a/llvm/include/llvm/Support/Base64.h
+++ b/llvm/include/llvm/Support/Base64.h
@@ -55,7 +55,8 @@ template <class InputBytes> std::string encodeBase64(InputBytes const &Bytes) {
return Buffer;
}
-LLVM_ABI llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
+LLVM_ABI llvm::Error decodeBase64(llvm::StringRef Input,
+ std::vector<char> &Output);
} // end namespace llvm
diff --git a/llvm/include/llvm/Support/BlockFrequency.h b/llvm/include/llvm/Support/BlockFrequency.h
index 4f630d28f7..ccae75dc51 100644
--- a/llvm/include/llvm/Support/BlockFrequency.h
+++ b/llvm/include/llvm/Support/BlockFrequency.h
@@ -122,7 +122,7 @@ public:
};
LLVM_ABI void printRelativeBlockFreq(raw_ostream &OS, BlockFrequency EntryFreq,
- BlockFrequency Freq);
+ BlockFrequency Freq);
} // namespace llvm
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index 50d5ea41ec..a677a684a2 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -67,7 +67,8 @@ struct CachePruningPolicy {
/// For example: "prune_interval=30s:prune_after=24h:cache_size=50%"
/// which means a pruning interval of 30 seconds, expiration time of 24 hours
/// and maximum cache size of 50% of available disk space.
-LLVM_ABI Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
+LLVM_ABI Expected<CachePruningPolicy>
+parseCachePruningPolicy(StringRef PolicyStr);
/// Peform pruning using the supplied policy, returns true if pruning
/// occurred, i.e. if Policy.Interval was expired.
@@ -80,8 +81,9 @@ LLVM_ABI Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicySt
/// As a safeguard against data loss if the user specifies the wrong directory
/// as their cache directory, this function will ignore files not matching the
/// pattern "llvmcache-*".
-LLVM_ABI bool pruneCache(StringRef Path, CachePruningPolicy Policy,
- const std::vector<std::unique_ptr<MemoryBuffer>> &Files = {});
+LLVM_ABI bool
+pruneCache(StringRef Path, CachePruningPolicy Policy,
+ const std::vector<std::unique_ptr<MemoryBuffer>> &Files = {});
} // namespace llvm
#endif
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
index e20cd30687..f31bd624da 100644
--- a/llvm/include/llvm/Support/Chrono.h
+++ b/llvm/include/llvm/Support/Chrono.h
@@ -88,13 +88,13 @@ LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, sys::UtcTime<> TP);
/// - %N is nanos: 000000000 - 999999999
///
/// If no options are given, the default format is "%Y-%m-%d %H:%M:%S.%N".
-template <>
-struct LLVM_ABI format_provider<sys::TimePoint<>> {
+template <> struct LLVM_ABI format_provider<sys::TimePoint<>> {
static void format(const sys::TimePoint<> &TP, llvm::raw_ostream &OS,
StringRef Style);
};
-template <> struct LLVM_ABI format_provider<sys::UtcTime<std::chrono::seconds>> {
+template <>
+struct LLVM_ABI format_provider<sys::UtcTime<std::chrono::seconds>> {
static void format(const sys::UtcTime<std::chrono::seconds> &TP,
llvm::raw_ostream &OS, StringRef Style);
};
@@ -103,12 +103,24 @@ namespace detail {
template <typename Period> struct unit { static const char value[]; };
template <typename Period> const char unit<Period>::value[] = "";
-template <> struct LLVM_ABI unit<std::ratio<3600>> { static const char value[]; };
-template <> struct LLVM_ABI unit<std::ratio<60>> { static const char value[]; };
-template <> struct LLVM_ABI unit<std::ratio<1>> { static const char value[]; };
-template <> struct LLVM_ABI unit<std::milli> { static const char value[]; };
-template <> struct LLVM_ABI unit<std::micro> { static const char value[]; };
-template <> struct LLVM_ABI unit<std::nano> { static const char value[]; };
+template <> struct LLVM_ABI unit<std::ratio<3600>> {
+ static const char value[];
+};
+template <> struct LLVM_ABI unit<std::ratio<60>> {
+ static const char value[];
+};
+template <> struct LLVM_ABI unit<std::ratio<1>> {
+ static const char value[];
+};
+template <> struct LLVM_ABI unit<std::milli> {
+ static const char value[];
+};
+template <> struct LLVM_ABI unit<std::micro> {
+ static const char value[];
+};
+template <> struct LLVM_ABI unit<std::nano> {
+ static const char value[];
+};
} // namespace detail
/// Implementation of format_provider<T> for duration types.
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index 2c685c5dc5..77aafd5a3a 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -67,10 +67,10 @@ namespace cl {
// that give precedence to earlier occurrences, you will need to extend this
// function to support it correctly.
LLVM_ABI bool ParseCommandLineOptions(int argc, const char *const *argv,
- StringRef Overview = "",
- raw_ostream *Errs = nullptr,
- const char *EnvVar = nullptr,
- bool LongOptionsUseDoubleDash = false);
+ StringRef Overview = "",
+ raw_ostream *Errs = nullptr,
+ const char *EnvVar = nullptr,
+ bool LongOptionsUseDoubleDash = false);
// Function pointer type for printing version information.
using VersionPrinterTy = std::function<void(raw_ostream &)>;
@@ -891,7 +891,8 @@ public:
//--------------------------------------------------
// Super class of parsers to provide boilerplate code
//
-class LLVM_ABI basic_parser_impl { // non-template implementation of basic_parser<t>
+class LLVM_ABI
+ basic_parser_impl { // non-template implementation of basic_parser<t>
public:
basic_parser_impl(Option &) {}
@@ -969,7 +970,8 @@ public:
extern template class LLVM_TEMPLATE_ABI basic_parser<boolOrDefault>;
-template <> class LLVM_ABI parser<boolOrDefault> : public basic_parser<boolOrDefault> {
+template <>
+class LLVM_ABI parser<boolOrDefault> : public basic_parser<boolOrDefault> {
public:
parser(Option &O) : basic_parser(O) {}
@@ -1079,7 +1081,8 @@ public:
extern template class LLVM_TEMPLATE_ABI basic_parser<unsigned long>;
template <>
-class LLVM_ABI parser<unsigned long> final : public basic_parser<unsigned long> {
+class LLVM_ABI parser<unsigned long> final
+ : public basic_parser<unsigned long> {
public:
parser(Option &O) : basic_parser(O) {}
@@ -1101,7 +1104,8 @@ public:
extern template class LLVM_TEMPLATE_ABI basic_parser<unsigned long long>;
template <>
-class LLVM_ABI parser<unsigned long long> : public basic_parser<unsigned long long> {
+class LLVM_ABI parser<unsigned long long>
+ : public basic_parser<unsigned long long> {
public:
parser(Option &O) : basic_parser(O) {}
@@ -1165,7 +1169,8 @@ public:
extern template class LLVM_TEMPLATE_ABI basic_parser<std::string>;
-template <> class LLVM_ABI parser<std::string> : public basic_parser<std::string> {
+template <>
+class LLVM_ABI parser<std::string> : public basic_parser<std::string> {
public:
parser(Option &O) : basic_parser(O) {}
@@ -2079,8 +2084,8 @@ getRegisteredSubcommands();
/// lines and end of the response file to be marked with a nullptr string.
/// \param [out] NewArgv All parsed strings are appended to NewArgv.
LLVM_ABI void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
- SmallVectorImpl<const char *> &NewArgv,
- bool MarkEOLs = false);
+ SmallVectorImpl<const char *> &NewArgv,
+ bool MarkEOLs = false);
/// Tokenizes a string of Windows command line arguments, which may contain
/// quotes and escaped quotes.
@@ -2097,15 +2102,16 @@ LLVM_ABI void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
/// lines and end of the response file to be marked with a nullptr string.
/// \param [out] NewArgv All parsed strings are appended to NewArgv.
LLVM_ABI void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver,
- SmallVectorImpl<const char *> &NewArgv,
- bool MarkEOLs = false);
+ SmallVectorImpl<const char *> &NewArgv,
+ bool MarkEOLs = false);
/// Tokenizes a Windows command line while attempting to avoid copies. If no
/// quoting or escaping was used, this produces substrings of the original
/// string. If a token requires unquoting, it will be allocated with the
/// StringSaver.
-LLVM_ABI void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver,
- SmallVectorImpl<StringRef> &NewArgv);
+LLVM_ABI void
+TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver,
+ SmallVectorImpl<StringRef> &NewArgv);
/// Tokenizes a Windows full command line, including command name at the start.
///
@@ -2120,9 +2126,10 @@ LLVM_ABI void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Sa
/// if you set MarkEOLs = true, then the first word of every line will be
/// parsed using the special rules for command names, making this function
/// suitable for parsing a file full of commands to execute.
-LLVM_ABI void TokenizeWindowsCommandLineFull(StringRef Source, StringSaver &Saver,
- SmallVectorImpl<const char *> &NewArgv,
- bool MarkEOLs = false);
+LLVM_ABI void
+TokenizeWindowsCommandLineFull(StringRef Source, StringSaver &Saver,
+ SmallVectorImpl<const char *> &NewArgv,
+ bool MarkEOLs = false);
/// String tokenization function type. Should be compatible with either
/// Windows or Unix command line tokenizers.
@@ -2140,8 +2147,8 @@ using TokenizerCallback = void (*)(StringRef Source, StringSaver &Saver,
/// It works like TokenizeGNUCommandLine with ability to skip comment lines.
///
LLVM_ABI void tokenizeConfigFile(StringRef Source, StringSaver &Saver,
- SmallVectorImpl<const char *> &NewArgv,
- bool MarkEOLs = false);
+ SmallVectorImpl<const char *> &NewArgv,
+ bool MarkEOLs = false);
/// Contains options that control response file expansion.
class LLVM_ABI ExpansionContext {
@@ -2234,21 +2241,23 @@ public:
/// environment variable EnvVar and command line options, then expands
/// response files recursively.
/// \return true if all @files were expanded successfully or there were none.
-LLVM_ABI bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
- SmallVectorImpl<const char *> &NewArgv);
+LLVM_ABI bool expandResponseFiles(int Argc, const char *const *Argv,
+ const char *EnvVar,
+ SmallVectorImpl<const char *> &NewArgv);
/// A convenience helper which supports the typical use case of expansion
/// function call.
-LLVM_ABI bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
- SmallVectorImpl<const char *> &Argv);
+LLVM_ABI bool ExpandResponseFiles(StringSaver &Saver,
+ TokenizerCallback Tokenizer,
+ SmallVectorImpl<const char *> &Argv);
/// A convenience helper which concatenates the options specified by the
/// environment variable EnvVar and command line options, then expands response
/// files recursively. The tokenizer is a predefined GNU or Windows one.
/// \return true if all @files were expanded successfully or there were none.
-LLVM_ABI bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
- StringSaver &Saver,
- SmallVectorImpl<const char *> &NewArgv);
+LLVM_ABI bool expandResponseFiles(int Argc, const char *const *Argv,
+ const char *EnvVar, StringSaver &Saver,
+ SmallVectorImpl<const char *> &NewArgv);
/// Mark all options not part of this category as cl::ReallyHidden.
///
@@ -2258,7 +2267,7 @@ LLVM_ABI bool expandResponseFiles(int Argc, const char *const *Argv, const char
/// not specific to the tool. This function allows a tool to specify a single
/// option category to display in the -help output.
LLVM_ABI void HideUnrelatedOptions(cl::OptionCategory &Category,
- SubCommand &Sub = SubCommand::getTopLevel());
+ SubCommand &Sub = SubCommand::getTopLevel());
/// Mark all options not part of the categories as cl::ReallyHidden.
///
@@ -2267,8 +2276,9 @@ LLVM_ABI void HideUnrelatedOptions(cl::OptionCategory &Category,
/// Some tools (like clang-format) like to be able to hide all options that are
/// not specific to the tool. This function allows a tool to specify a single
/// option category to display in the -help output.
-LLVM_ABI void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
- SubCommand &Sub = SubCommand::getTopLevel());
+LLVM_ABI void
+HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
+ SubCommand &Sub = SubCommand::getTopLevel());
/// Reset all command line options to a state that looks as if they have
/// never appeared on the command line. This is useful for being able to parse
diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h
index 96dc6504ea..246ccbd6f6 100644
--- a/llvm/include/llvm/Support/Compression.h
+++ b/llvm/include/llvm/Support/Compression.h
@@ -42,14 +42,15 @@ constexpr int BestSizeCompression = 9;
LLVM_ABI bool isAvailable();
LLVM_ABI void compress(ArrayRef<uint8_t> Input,
- SmallVectorImpl<uint8_t> &CompressedBuffer,
- int Level = DefaultCompression);
+ SmallVectorImpl<uint8_t> &CompressedBuffer,
+ int Level = DefaultCompression);
LLVM_ABI Error decompress(ArrayRef<uint8_t> Input, uint8_t *Output,
- size_t &UncompressedSize);
+ size_t &UncompressedSize);
-LLVM_ABI Error decompress(ArrayRef<uint8_t> Input, SmallVectorImpl<uint8_t> &Output,
- size_t UncompressedSize);
+LLVM_ABI Error decompress(ArrayRef<uint8_t> Input,
+ SmallVectorImpl<uint8_t> &Output,
+ size_t UncompressedSize);
} // End of namespace zlib
@@ -63,14 +64,15 @@ constexpr int BestSizeCompression = 12;
LLVM_ABI bool isAvailable();
LLVM_ABI void compress(ArrayRef<uint8_t> Input,
- SmallVectorImpl<uint8_t> &CompressedBuffer,
- int Level = DefaultCompression, bool EnableLdm = false);
+ SmallVectorImpl<uint8_t> &CompressedBuffer,
+ int Level = DefaultCompression, bool EnableLdm = false);
LLVM_ABI Error decompress(ArrayRef<uint8_t> Input, uint8_t *Output,
- size_t &UncompressedSize);
+ size_t &UncompressedSize);
-LLVM_ABI Error decompress(ArrayRef<uint8_t> Input, SmallVectorImpl<uint8_t> &Output,
- size_t UncompressedSize);
+LLVM_ABI Error decompress(ArrayRef<uint8_t> Input,
+ SmallVectorImpl<uint8_t> &Output,
+ size_t UncompressedSize);
} // End of namespace zstd
@@ -115,15 +117,17 @@ LLVM_ABI const char *getReasonIfUnsupported(Format F);
// Compress Input with the specified format P.Format. If Level is -1, use
// *::DefaultCompression for the format.
LLVM_ABI void compress(Params P, ArrayRef<uint8_t> Input,
- SmallVectorImpl<uint8_t> &Output);
+ SmallVectorImpl<uint8_t> &Output);
// Decompress Input. The uncompressed size must be available.
LLVM_ABI Error decompress(DebugCompressionType T, ArrayRef<uint8_t> Input,
- uint8_t *Output, size_t UncompressedSize);
+ uint8_t *Output, size_t UncompressedSize);
LLVM_ABI Error decompress(Format F, ArrayRef<uint8_t> Input,
- SmallVectorImpl<uint8_t> &Output, size_t UncompressedSize);
+ SmallVectorImpl<uint8_t> &Output,
+ size_t UncompressedSize);
LLVM_ABI Error decompress(DebugCompressionType T, ArrayRef<uint8_t> Input,
- SmallVectorImpl<uint8_t> &Output, size_t UncompressedSize);
+ SmallVectorImpl<uint8_t> &Output,
+ size_t UncompressedSize);
} // End of namespace compression
diff --git a/llvm/include/llvm/Support/ConvertEBCDIC.h b/llvm/include/llvm/Support/ConvertEBCDIC.h
index 30d98a8378..1ed88b9a90 100644
--- a/llvm/include/llvm/Support/ConvertEBCDIC.h
+++ b/llvm/include/llvm/Support/ConvertEBCDIC.h
@@ -21,7 +21,7 @@
namespace llvm {
namespace ConverterEBCDIC {
LLVM_ABI std::error_code convertToEBCDIC(StringRef Source,
- SmallVectorImpl<char> &Result);
+ SmallVectorImpl<char> &Result);
LLVM_ABI void convertToUTF8(StringRef Source, SmallVectorImpl<char> &Result);
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h
index 234e859d0f..71b37d6b20 100644
--- a/llvm/include/llvm/Support/ConvertUTF.h
+++ b/llvm/include/llvm/Support/ConvertUTF.h
@@ -158,47 +158,62 @@ typedef enum {
lenientConversion
} ConversionFlags;
-LLVM_ABI ConversionResult ConvertUTF8toUTF16 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+LLVM_ABI ConversionResult ConvertUTF8toUTF16(const UTF8 **sourceStart,
+ const UTF8 *sourceEnd,
+ UTF16 **targetStart,
+ UTF16 *targetEnd,
+ ConversionFlags flags);
/**
* Convert a partial UTF8 sequence to UTF32. If the sequence ends in an
* incomplete code unit sequence, returns \c sourceExhausted.
*/
-LLVM_ABI ConversionResult ConvertUTF8toUTF32Partial(
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+LLVM_ABI ConversionResult ConvertUTF8toUTF32Partial(const UTF8 **sourceStart,
+ const UTF8 *sourceEnd,
+ UTF32 **targetStart,
+ UTF32 *targetEnd,
+ ConversionFlags flags);
/**
* Convert a partial UTF8 sequence to UTF32. If the sequence ends in an
* incomplete code unit sequence, returns \c sourceIllegal.
*/
-LLVM_ABI ConversionResult ConvertUTF8toUTF32(
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
-
-LLVM_ABI ConversionResult ConvertUTF16toUTF8 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
-LLVM_ABI ConversionResult ConvertUTF32toUTF8 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
-LLVM_ABI ConversionResult ConvertUTF16toUTF32 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
-
-LLVM_ABI ConversionResult ConvertUTF32toUTF16 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+LLVM_ABI ConversionResult ConvertUTF8toUTF32(const UTF8 **sourceStart,
+ const UTF8 *sourceEnd,
+ UTF32 **targetStart,
+ UTF32 *targetEnd,
+ ConversionFlags flags);
+
+LLVM_ABI ConversionResult ConvertUTF16toUTF8(const UTF16 **sourceStart,
+ const UTF16 *sourceEnd,
+ UTF8 **targetStart,
+ UTF8 *targetEnd,
+ ConversionFlags flags);
+
+LLVM_ABI ConversionResult ConvertUTF32toUTF8(const UTF32 **sourceStart,
+ const UTF32 *sourceEnd,
+ UTF8 **targetStart,
+ UTF8 *targetEnd,
+ ConversionFlags flags);
+
+LLVM_ABI ConversionResult ConvertUTF16toUTF32(const UTF16 **sourceStart,
+ const UTF16 *sourceEnd,
+ UTF32 **targetStart,
+ UTF32 *targetEnd,
+ ConversionFlags flags);
+
+LLVM_ABI ConversionResult ConvertUTF32toUTF16(const UTF32 **sourceStart,
+ const UTF32 *sourceEnd,
+ UTF16 **targetStart,
+ UTF16 *targetEnd,
+ ConversionFlags flags);
LLVM_ABI Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
LLVM_ABI Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
-LLVM_ABI unsigned getUTF8SequenceSize(const UTF8 *source, const UTF8 *sourceEnd);
+LLVM_ABI unsigned getUTF8SequenceSize(const UTF8 *source,
+ const UTF8 *sourceEnd);
LLVM_ABI unsigned getNumBytesForUTF8(UTF8 firstByte);
@@ -219,7 +234,7 @@ class StringRef;
* \return true on success.
*/
LLVM_ABI bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
- char *&ResultPtr, const UTF8 *&ErrorPtr);
+ char *&ResultPtr, const UTF8 *&ErrorPtr);
/**
* Converts a UTF-8 StringRef to a std::wstring.
@@ -237,8 +252,8 @@ LLVM_ABI bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
* Converts a std::wstring to a UTF-8 encoded std::string.
* \return true on success.
*/
-LLVM_ABI bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
-
+LLVM_ABI bool convertWideToUTF8(const std::wstring &Source,
+ std::string &Result);
/**
* Convert an Unicode code point to UTF8 sequence.
@@ -292,7 +307,8 @@ LLVM_ABI bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
* \param [out] Out Converted UTF-8 is stored here on success.
* \returns true on success
*/
-LLVM_ABI bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
+LLVM_ABI bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes,
+ std::string &Out);
/**
* Converts a UTF16 string into a UTF8 std::string.
@@ -310,7 +326,8 @@ LLVM_ABI bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
* \param [out] Out Converted UTF-8 is stored here on success.
* \returns true on success
*/
-LLVM_ABI bool convertUTF32ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
+LLVM_ABI bool convertUTF32ToUTF8String(ArrayRef<char> SrcBytes,
+ std::string &Out);
/**
* Converts a UTF32 string into a UTF8 std::string.
@@ -327,19 +344,21 @@ LLVM_ABI bool convertUTF32ToUTF8String(ArrayRef<UTF32> Src, std::string &Out);
* \returns true on success
*/
LLVM_ABI bool convertUTF8ToUTF16String(StringRef SrcUTF8,
- SmallVectorImpl<UTF16> &DstUTF16);
+ SmallVectorImpl<UTF16> &DstUTF16);
#if defined(_WIN32)
namespace sys {
namespace windows {
-LLVM_ABI std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
+LLVM_ABI std::error_code UTF8ToUTF16(StringRef utf8,
+ SmallVectorImpl<wchar_t> &utf16);
/// Convert to UTF16 from the current code page used in the system
-LLVM_ABI std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
+LLVM_ABI std::error_code CurCPToUTF16(StringRef utf8,
+ SmallVectorImpl<wchar_t> &utf16);
LLVM_ABI std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
- SmallVectorImpl<char> &utf8);
+ SmallVectorImpl<char> &utf8);
/// Convert from UTF16 to the current code page used in the system
LLVM_ABI std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len,
- SmallVectorImpl<char> &utf8);
+ SmallVectorImpl<char> &utf8);
} // namespace windows
} // namespace sys
#endif
diff --git a/llvm/include/llvm/Support/ELFAttributes.h b/llvm/include/llvm/Support/ELFAttributes.h
index 6b16731a8f..8b83c5e7f4 100644
--- a/llvm/include/llvm/Support/ELFAttributes.h
+++ b/llvm/include/llvm/Support/ELFAttributes.h
@@ -28,8 +28,9 @@ namespace ELFAttrs {
enum AttrType : unsigned { File = 1, Section = 2, Symbol = 3 };
LLVM_ABI StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
- bool hasTagPrefix = true);
-LLVM_ABI std::optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
+ bool hasTagPrefix = true);
+LLVM_ABI std::optional<unsigned> attrTypeFromString(StringRef tag,
+ TagNameMap tagNameMap);
// Magic numbers for ELF attributes.
enum AttrMagic { Format_Version = 0x41 };
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h
index d9a492ed35..3cd8a83abc 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -738,7 +738,8 @@ private:
/// Report a serious error, calling any installed error handler. See
/// ErrorHandling.h.
-[[noreturn]] void LLVM_ABI report_fatal_error(Error Err, bool gen_crash_diag = true);
+[[noreturn]] void LLVM_ABI report_fatal_error(Error Err,
+ bool gen_crash_diag = true);
/// Report a fatal error if Err is a failure value.
///
@@ -1049,7 +1050,8 @@ Expected<T> handleExpected(Expected<T> ValOrErr, RecoveryFtor &&RecoveryPath,
/// This is useful in the base level of your program to allow clean termination
/// (allowing clean deallocation of resources, etc.), while reporting error
/// information to the user.
-LLVM_ABI void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner = {});
+LLVM_ABI void logAllUnhandledErrors(Error E, raw_ostream &OS,
+ Twine ErrorBanner = {});
/// Write all error messages (if any) in E to a string. The newline character
/// is used to separate error messages.
diff --git a/llvm/include/llvm/Support/ErrorHandling.h b/llvm/include/llvm/Support/ErrorHandling.h
index 602189d534..db988d4ae6 100644
--- a/llvm/include/llvm/Support/ErrorHandling.h
+++ b/llvm/include/llvm/Support/ErrorHandling.h
@@ -42,7 +42,7 @@ namespace llvm {
/// \param user_data - An argument which will be passed to the install error
/// handler.
LLVM_ABI void install_fatal_error_handler(fatal_error_handler_t handler,
- void *user_data = nullptr);
+ void *user_data = nullptr);
/// Restores default error handling behaviour.
LLVM_ABI void remove_fatal_error_handler();
@@ -68,58 +68,57 @@ namespace llvm {
/// After the error handler is called this function will call abort(), it
/// does not return.
/// NOTE: The std::string variant was removed to avoid a <string> dependency.
-[[noreturn]] void LLVM_ABI report_fatal_error(const char *reason,
- bool gen_crash_diag = true);
-[[noreturn]] void LLVM_ABI report_fatal_error(StringRef reason,
- bool gen_crash_diag = true);
-[[noreturn]] void LLVM_ABI report_fatal_error(const Twine &reason,
- bool gen_crash_diag = true);
-
-/// Installs a new bad alloc error handler that should be used whenever a
-/// bad alloc error, e.g. failing malloc/calloc, is encountered by LLVM.
-///
-/// The user can install a bad alloc handler, in order to define the behavior
-/// in case of failing allocations, e.g. throwing an exception. Note that this
-/// handler must not trigger any additional allocations itself.
-///
-/// If no error handler is installed the default is to print the error message
-/// to stderr, and call exit(1). If an error handler is installed then it is
-/// the handler's responsibility to log the message, it will no longer be
-/// printed to stderr. If the error handler returns, then exit(1) will be
-/// called.
-///
-///
-/// \param user_data - An argument which will be passed to the installed error
-/// handler.
-LLVM_ABI void install_bad_alloc_error_handler(fatal_error_handler_t handler,
- void *user_data = nullptr);
+ [[noreturn]] void LLVM_ABI report_fatal_error(const char *reason,
+ bool gen_crash_diag = true);
+ [[noreturn]] void LLVM_ABI report_fatal_error(StringRef reason,
+ bool gen_crash_diag = true);
+ [[noreturn]] void LLVM_ABI report_fatal_error(const Twine &reason,
+ bool gen_crash_diag = true);
+
+ /// Installs a new bad alloc error handler that should be used whenever a
+ /// bad alloc error, e.g. failing malloc/calloc, is encountered by LLVM.
+ ///
+ /// The user can install a bad alloc handler, in order to define the behavior
+ /// in case of failing allocations, e.g. throwing an exception. Note that this
+ /// handler must not trigger any additional allocations itself.
+ ///
+ /// If no error handler is installed the default is to print the error message
+ /// to stderr, and call exit(1). If an error handler is installed then it is
+ /// the handler's responsibility to log the message, it will no longer be
+ /// printed to stderr. If the error handler returns, then exit(1) will be
+ /// called.
+ ///
+ ///
+ /// \param user_data - An argument which will be passed to the installed error
+ /// handler.
+ LLVM_ABI void install_bad_alloc_error_handler(fatal_error_handler_t handler,
+ void *user_data = nullptr);
-/// Restores default bad alloc error handling behavior.
-LLVM_ABI void remove_bad_alloc_error_handler();
+ /// Restores default bad alloc error handling behavior.
+ LLVM_ABI void remove_bad_alloc_error_handler();
-LLVM_ABI void install_out_of_memory_new_handler();
+ LLVM_ABI void install_out_of_memory_new_handler();
-/// Reports a bad alloc error, calling any user defined bad alloc
-/// error handler. In contrast to the generic 'report_fatal_error'
-/// functions, this function might not terminate, e.g. the user
-/// defined error handler throws an exception, but it won't return.
-///
-/// Note: When throwing an exception in the bad alloc handler, make sure that
-/// the following unwind succeeds, e.g. do not trigger additional allocations
-/// in the unwind chain.
-///
-/// If no error handler is installed (default), throws a bad_alloc exception
-/// if LLVM is compiled with exception support. Otherwise prints the error
-/// to standard error and calls abort().
-[[noreturn]] void LLVM_ABI report_bad_alloc_error(const char *Reason,
- bool GenCrashDiag = true);
-
-/// This function calls abort(), and prints the optional message to stderr.
-/// Use the llvm_unreachable macro (that adds location info), instead of
-/// calling this function directly.
-[[noreturn]] void
-LLVM_ABI llvm_unreachable_internal(const char *msg = nullptr, const char *file = nullptr,
- unsigned line = 0);
+ /// Reports a bad alloc error, calling any user defined bad alloc
+ /// error handler. In contrast to the generic 'report_fatal_error'
+ /// functions, this function might not terminate, e.g. the user
+ /// defined error handler throws an exception, but it won't return.
+ ///
+ /// Note: When throwing an exception in the bad alloc handler, make sure that
+ /// the following unwind succeeds, e.g. do not trigger additional allocations
+ /// in the unwind chain.
+ ///
+ /// If no error handler is installed (default), throws a bad_alloc exception
+ /// if LLVM is compiled with exception support. Otherwise prints the error
+ /// to standard error and calls abort().
+ [[noreturn]] void LLVM_ABI report_bad_alloc_error(const char *Reason,
+ bool GenCrashDiag = true);
+
+ /// This function calls abort(), and prints the optional message to stderr.
+ /// Use the llvm_unreachable macro (that adds location info), instead of
+ /// calling this function directly.
+ [[noreturn]] void LLVM_ABI llvm_unreachable_internal(
+ const char *msg = nullptr, const char *file = nullptr, unsigned line = 0);
}
/// Marks that the current location is not supposed to be reachable.
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
index cefdb21eb2..40fb0de68d 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -226,11 +226,11 @@ public:
class LLVM_ABI file_status : public basic_file_status {
friend LLVM_ABI bool equivalent(file_status A, file_status B);
- #if defined(LLVM_ON_UNIX)
+#if defined(LLVM_ON_UNIX)
dev_t fs_st_dev = 0;
nlink_t fs_st_nlinks = 0;
ino_t fs_st_ino = 0;
- #elif defined (_WIN32)
+#elif defined (_WIN32)
uint32_t NumLinks = 0;
uint32_t VolumeSerialNumber = 0;
uint64_t PathHash = 0;
@@ -279,7 +279,8 @@ public:
/// relative/../path => <current-directory>/relative/../path
///
/// @param path A path that is modified to be an absolute path.
-LLVM_ABI void make_absolute(const Twine ¤t_directory, SmallVectorImpl<char> &path);
+LLVM_ABI void make_absolute(const Twine ¤t_directory,
+ SmallVectorImpl<char> &path);
/// Make \a path an absolute path.
///
@@ -300,9 +301,9 @@ LLVM_ABI std::error_code make_absolute(SmallVectorImpl<char> &path);
/// @returns errc::success if is_directory(path), otherwise a platform
/// specific error_code. If IgnoreExisting is false, also returns
/// error if the directory already existed.
-LLVM_ABI std::error_code create_directories(const Twine &path,
- bool IgnoreExisting = true,
- perms Perms = owner_all | group_all);
+LLVM_ABI std::error_code
+create_directories(const Twine &path, bool IgnoreExisting = true,
+ perms Perms = owner_all | group_all);
/// Create the directory in path.
///
@@ -310,8 +311,9 @@ LLVM_ABI std::error_code create_directories(const Twine &path,
/// @returns errc::success if is_directory(path), otherwise a platform
/// specific error_code. If IgnoreExisting is false, also returns
/// error if the directory already existed.
-LLVM_ABI std::error_code create_directory(const Twine &path, bool IgnoreExisting = true,
- perms Perms = owner_all | group_all);
+LLVM_ABI std::error_code create_directory(const Twine &path,
+ bool IgnoreExisting = true,
+ perms Perms = owner_all | group_all);
/// Create a link from \a from to \a to.
///
@@ -341,8 +343,9 @@ LLVM_ABI std::error_code create_hard_link(const Twine &to, const Twine &from);
/// @param output The location to store the resolved path.
/// @param expand_tilde If true, resolves ~ expressions to the user's home
/// directory.
-LLVM_ABI std::error_code real_path(const Twine &path, SmallVectorImpl<char> &output,
- bool expand_tilde = false);
+LLVM_ABI std::error_code real_path(const Twine &path,
+ SmallVectorImpl<char> &output,
+ bool expand_tilde = false);
/// Expands ~ expressions to the user's home directory. On Unix ~user
/// directories are resolved as well.
@@ -370,14 +373,16 @@ LLVM_ABI std::error_code set_current_path(const Twine &path);
/// @returns errc::success if path has been removed or didn't exist, otherwise a
/// platform-specific error code. If IgnoreNonExisting is false, also
/// returns error if the file didn't exist.
-LLVM_ABI std::error_code remove(const Twine &path, bool IgnoreNonExisting = true);
+LLVM_ABI std::error_code remove(const Twine &path,
+ bool IgnoreNonExisting = true);
/// Recursively delete a directory.
///
/// @param path Input path.
/// @returns errc::success if path has been removed or didn't exist, otherwise a
/// platform-specific error code.
-LLVM_ABI std::error_code remove_directories(const Twine &path, bool IgnoreErrors = true);
+LLVM_ABI std::error_code remove_directories(const Twine &path,
+ bool IgnoreErrors = true);
/// Rename \a from to \a to.
///
@@ -497,7 +502,8 @@ LLVM_ABI bool equivalent(file_status A, file_status B);
/// inode (or equivalent).
/// @returns errc::success if result has been successfully set, otherwise a
/// platform-specific error_code.
-LLVM_ABI std::error_code equivalent(const Twine &A, const Twine &B, bool &result);
+LLVM_ABI std::error_code equivalent(const Twine &A, const Twine &B,
+ bool &result);
/// Simpler version of equivalent for clients that don't need to
/// differentiate between an error and false.
@@ -636,7 +642,7 @@ LLVM_ABI std::error_code is_other(const Twine &path, bool &result);
/// @returns errc::success if result has been successfully set, otherwise a
/// platform-specific error_code.
LLVM_ABI std::error_code status(const Twine &path, file_status &result,
- bool follow = true);
+ bool follow = true);
/// A version for when a file descriptor is already available.
LLVM_ABI std::error_code status(int FD, file_status &Result);
@@ -700,8 +706,9 @@ inline std::error_code file_size(const Twine &Path, uint64_t &Result) {
/// @returns errc::success if the file times were successfully set, otherwise a
/// platform-specific error_code or errc::function_not_supported on
/// platforms where the functionality isn't available.
-LLVM_ABI std::error_code setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime,
- TimePoint<> ModificationTime);
+LLVM_ABI std::error_code
+setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime,
+ TimePoint<> ModificationTime);
/// Simpler version that sets both file modification and access time to the same
/// time.
@@ -801,8 +808,9 @@ enum OpenFlags : unsigned {
/// @param Model Name to base unique path off of.
/// @param ResultPath Set to the file's path.
/// @param MakeAbsolute Whether to use the system temp directory.
-LLVM_ABI void createUniquePath(const Twine &Model, SmallVectorImpl<char> &ResultPath,
- bool MakeAbsolute);
+LLVM_ABI void createUniquePath(const Twine &Model,
+ SmallVectorImpl<char> &ResultPath,
+ bool MakeAbsolute);
/// Create a uniquely named file.
///
@@ -828,15 +836,15 @@ LLVM_ABI void createUniquePath(const Twine &Model, SmallVectorImpl<char> &Result
/// @returns errc::success if Result{FD,Path} have been successfully set,
/// otherwise a platform-specific error_code.
LLVM_ABI std::error_code createUniqueFile(const Twine &Model, int &ResultFD,
- SmallVectorImpl<char> &ResultPath,
- OpenFlags Flags = OF_None,
- unsigned Mode = all_read | all_write);
+ SmallVectorImpl<char> &ResultPath,
+ OpenFlags Flags = OF_None,
+ unsigned Mode = all_read | all_write);
/// Simpler version for clients that don't want an open file. An empty
/// file will still be created.
LLVM_ABI std::error_code createUniqueFile(const Twine &Model,
- SmallVectorImpl<char> &ResultPath,
- unsigned Mode = all_read | all_write);
+ SmallVectorImpl<char> &ResultPath,
+ unsigned Mode = all_read | all_write);
/// Represents a temporary file.
///
@@ -890,19 +898,20 @@ public:
///
/// This should be used for things like a temporary .s that is removed after
/// running the assembler.
-LLVM_ABI std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
- int &ResultFD,
- SmallVectorImpl<char> &ResultPath,
- OpenFlags Flags = OF_None);
+LLVM_ABI std::error_code createTemporaryFile(const Twine &Prefix,
+ StringRef Suffix, int &ResultFD,
+ SmallVectorImpl<char> &ResultPath,
+ OpenFlags Flags = OF_None);
/// Simpler version for clients that don't want an open file. An empty
/// file will still be created.
-LLVM_ABI std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
- SmallVectorImpl<char> &ResultPath,
- OpenFlags Flags = OF_None);
+LLVM_ABI std::error_code createTemporaryFile(const Twine &Prefix,
+ StringRef Suffix,
+ SmallVectorImpl<char> &ResultPath,
+ OpenFlags Flags = OF_None);
-LLVM_ABI std::error_code createUniqueDirectory(const Twine &Prefix,
- SmallVectorImpl<char> &ResultPath);
+LLVM_ABI std::error_code
+createUniqueDirectory(const Twine &Prefix, SmallVectorImpl<char> &ResultPath);
/// Get a unique name, not currently exisiting in the filesystem. Subject
/// to race conditions, prefer to use createUniqueFile instead.
@@ -911,8 +920,9 @@ LLVM_ABI std::error_code createUniqueDirectory(const Twine &Prefix,
/// checks if it exists. This function is subject to race conditions, if you
/// want to use the returned name to actually create a file, use
/// createUniqueFile instead.
-LLVM_ABI std::error_code getPotentiallyUniqueFileName(const Twine &Model,
- SmallVectorImpl<char> &ResultPath);
+LLVM_ABI std::error_code
+getPotentiallyUniqueFileName(const Twine &Model,
+ SmallVectorImpl<char> &ResultPath);
/// Get a unique temporary file name, not currently exisiting in the
/// filesystem. Subject to race conditions, prefer to use createTemporaryFile
@@ -961,8 +971,8 @@ inline FileAccess &operator|=(FileAccess &A, FileAccess B) {
/// @returns errc::success if \a Name has been opened, otherwise a
/// platform-specific error_code.
LLVM_ABI std::error_code openFile(const Twine &Name, int &ResultFD,
- CreationDisposition Disp, FileAccess Access,
- OpenFlags Flags, unsigned Mode = 0666);
+ CreationDisposition Disp, FileAccess Access,
+ OpenFlags Flags, unsigned Mode = 0666);
/// @brief Opens a file with the specified creation disposition, access mode,
/// and flags and returns a platform-specific file object.
@@ -978,9 +988,10 @@ LLVM_ABI std::error_code openFile(const Twine &Name, int &ResultFD,
/// @param Mode The access permissions of the file, represented in octal.
/// @returns errc::success if \a Name has been opened, otherwise a
/// platform-specific error_code.
-LLVM_ABI Expected<file_t> openNativeFile(const Twine &Name, CreationDisposition Disp,
- FileAccess Access, OpenFlags Flags,
- unsigned Mode = 0666);
+LLVM_ABI Expected<file_t> openNativeFile(const Twine &Name,
+ CreationDisposition Disp,
+ FileAccess Access, OpenFlags Flags,
+ unsigned Mode = 0666);
/// Converts from a Posix file descriptor number to a native file handle.
/// On Windows, this retreives the underlying handle. On non-Windows, this is a
@@ -1010,7 +1021,8 @@ LLVM_ABI file_t getStderrHandle();
/// @param FileHandle File to read from.
/// @param Buf Buffer to read into.
/// @returns The number of bytes read, or error.
-LLVM_ABI Expected<size_t> readNativeFile(file_t FileHandle, MutableArrayRef<char> Buf);
+LLVM_ABI Expected<size_t> readNativeFile(file_t FileHandle,
+ MutableArrayRef<char> Buf);
/// Default chunk size for \a readNativeFileToEOF().
enum : size_t { DefaultReadChunkSize = 4 * 4096 };
@@ -1028,8 +1040,9 @@ enum : size_t { DefaultReadChunkSize = 4 * 4096 };
/// \param Buffer Where to put the file content.
/// \param ChunkSize Size of chunks.
/// \returns The error if EOF was not found.
-LLVM_ABI Error readNativeFileToEOF(file_t FileHandle, SmallVectorImpl<char> &Buffer,
- ssize_t ChunkSize = DefaultReadChunkSize);
+LLVM_ABI Error readNativeFileToEOF(file_t FileHandle,
+ SmallVectorImpl<char> &Buffer,
+ ssize_t ChunkSize = DefaultReadChunkSize);
/// Reads \p Buf.size() bytes from \p FileHandle at offset \p Offset into \p
/// Buf. If 'pread' is available, this will use that, otherwise it will use
@@ -1041,8 +1054,8 @@ LLVM_ABI Error readNativeFileToEOF(file_t FileHandle, SmallVectorImpl<char> &Buf
/// @param Offset Offset into the file at which the read should occur.
/// @returns The number of bytes read, or error.
LLVM_ABI Expected<size_t> readNativeFileSlice(file_t FileHandle,
- MutableArrayRef<char> Buf,
- uint64_t Offset);
+ MutableArrayRef<char> Buf,
+ uint64_t Offset);
/// @brief Opens the file with the given name in a write-only or read-write
/// mode, returning its open file descriptor. If the file does not exist, it
@@ -1142,9 +1155,9 @@ inline Expected<file_t> openNativeFileForReadWrite(const Twine &Name,
/// location.
/// @returns errc::success if \a Name has been opened, otherwise a
/// platform-specific error_code.
-LLVM_ABI std::error_code openFileForRead(const Twine &Name, int &ResultFD,
- OpenFlags Flags = OF_None,
- SmallVectorImpl<char> *RealPath = nullptr);
+LLVM_ABI std::error_code
+openFileForRead(const Twine &Name, int &ResultFD, OpenFlags Flags = OF_None,
+ SmallVectorImpl<char> *RealPath = nullptr);
/// @brief Opens the file with the given name in a read-only mode, returning
/// its open file descriptor.
@@ -1399,7 +1412,8 @@ namespace detail {
struct DirIterState;
- LLVM_ABI std::error_code directory_iterator_construct(DirIterState &, StringRef, bool);
+ LLVM_ABI std::error_code directory_iterator_construct(DirIterState &,
+ StringRef, bool);
LLVM_ABI std::error_code directory_iterator_increment(DirIterState &);
LLVM_ABI std::error_code directory_iterator_destruct(DirIterState &);
diff --git a/llvm/include/llvm/Support/FileUtilities.h b/llvm/include/llvm/Support/FileUtilities.h
index 70b1b53958..558b17bb82 100644
--- a/llvm/include/llvm/Support/FileUtilities.h
+++ b/llvm/include/llvm/Support/FileUtilities.h
@@ -30,51 +30,50 @@ namespace llvm {
/// option, it will set the string to an error message if an error occurs, or
/// if the files are different.
///
- LLVM_ABI int DiffFilesWithTolerance(StringRef FileA,
- StringRef FileB,
- double AbsTol, double RelTol,
- std::string *Error = nullptr);
-
-
- /// FileRemover - This class is a simple object meant to be stack allocated.
- /// If an exception is thrown from a region, the object removes the filename
- /// specified (if deleteIt is true).
- ///
- class FileRemover {
- SmallString<128> Filename;
- bool DeleteIt;
- public:
- FileRemover() : DeleteIt(false) {}
-
- explicit FileRemover(const Twine& filename, bool deleteIt = true)
+LLVM_ABI int DiffFilesWithTolerance(StringRef FileA, StringRef FileB,
+ double AbsTol, double RelTol,
+ std::string *Error = nullptr);
+
+/// FileRemover - This class is a simple object meant to be stack allocated.
+/// If an exception is thrown from a region, the object removes the filename
+/// specified (if deleteIt is true).
+///
+class FileRemover {
+ SmallString<128> Filename;
+ bool DeleteIt;
+
+public:
+ FileRemover() : DeleteIt(false) {}
+
+ explicit FileRemover(const Twine &filename, bool deleteIt = true)
: DeleteIt(deleteIt) {
- filename.toVector(Filename);
- }
+ filename.toVector(Filename);
+ }
- ~FileRemover() {
- if (DeleteIt) {
- // Ignore problems deleting the file.
- sys::fs::remove(Filename);
- }
+ ~FileRemover() {
+ if (DeleteIt) {
+ // Ignore problems deleting the file.
+ sys::fs::remove(Filename);
}
-
- /// setFile - Give ownership of the file to the FileRemover so it will
- /// be removed when the object is destroyed. If the FileRemover already
- /// had ownership of a file, remove it first.
- void setFile(const Twine& filename, bool deleteIt = true) {
- if (DeleteIt) {
- // Ignore problems deleting the file.
- sys::fs::remove(Filename);
- }
-
- Filename.clear();
- filename.toVector(Filename);
- DeleteIt = deleteIt;
+ }
+
+ /// setFile - Give ownership of the file to the FileRemover so it will
+ /// be removed when the object is destroyed. If the FileRemover already
+ /// had ownership of a file, remove it first.
+ void setFile(const Twine &filename, bool deleteIt = true) {
+ if (DeleteIt) {
+ // Ignore problems deleting the file.
+ sys::fs::remove(Filename);
}
- /// releaseFile - Take ownership of the file away from the FileRemover so it
- /// will not be removed when the object is destroyed.
- void releaseFile() { DeleteIt = false; }
+ Filename.clear();
+ filename.toVector(Filename);
+ DeleteIt = deleteIt;
+ }
+
+ /// releaseFile - Take ownership of the file away from the FileRemover so it
+ /// will not be removed when the object is destroyed.
+ void releaseFile() { DeleteIt = false; }
};
/// FilePermssionsApplier helps to copy permissions from an input file to
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h
index fdc537e701..8b619a3a9c 100644
--- a/llvm/include/llvm/Support/GraphWriter.h
+++ b/llvm/include/llvm/Support/GraphWriter.h
@@ -59,7 +59,7 @@ enum Name {
} // end namespace GraphProgram
LLVM_ABI bool DisplayGraph(StringRef Filename, bool wait = true,
- GraphProgram::Name program = GraphProgram::DOT);
+ GraphProgram::Name program = GraphProgram::DOT);
template<typename GraphType>
class GraphWriter {
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index 0067d7eef4..7c9d28c858 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -647,7 +647,8 @@ inline bool Object::erase(StringRef K) {
return M.erase(ObjectKey(K));
}
-LLVM_ABI std::vector<const Object::value_type *> sortedElements(const Object &O);
+LLVM_ABI std::vector<const Object::value_type *>
+sortedElements(const Object &O);
/// A "cursor" marking a position within a Value.
/// The Value is a tree, and this is the path from the root to the current node.
@@ -977,7 +978,7 @@ Expected<T> parse(const llvm::StringRef &JSON, const char *RootName = "") {
/// an array, and so on.
/// With asserts disabled, this is undefined behavior.
class LLVM_ABI OStream {
- public:
+public:
using Block = llvm::function_ref<void()>;
// If IndentSize is nonzero, output is pretty-printed.
explicit OStream(llvm::raw_ostream &OS, unsigned IndentSize = 0)
diff --git a/llvm/include/llvm/Support/Locale.h b/llvm/include/llvm/Support/Locale.h
index e865dfb70d..485ef8fee6 100644
--- a/llvm/include/llvm/Support/Locale.h
+++ b/llvm/include/llvm/Support/Locale.h
@@ -10,7 +10,6 @@ namespace locale {
LLVM_ABI int columnWidth(StringRef s);
LLVM_ABI bool isPrint(int c);
-
}
}
}
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index 45adc411b4..06f80920e2 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -171,7 +171,8 @@ namespace sys {
#ifndef NDEBUG
/// Debugging output for Memory::ProtectionFlags.
- LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const Memory::ProtectionFlags &PF);
+ LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
+ const Memory::ProtectionFlags &PF);
/// Debugging output for MemoryBlock.
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const MemoryBlock &MB);
diff --git a/llvm/include/llvm/Support/NativeFormatting.h b/llvm/include/llvm/Support/NativeFormatting.h
index 425d0e46e8..45336511ae 100644
--- a/llvm/include/llvm/Support/NativeFormatting.h
+++ b/llvm/include/llvm/Support/NativeFormatting.h
@@ -27,21 +27,22 @@ LLVM_ABI size_t getDefaultPrecision(FloatStyle Style);
LLVM_ABI bool isPrefixedHexStyle(HexPrintStyle S);
LLVM_ABI void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
- IntegerStyle Style);
-LLVM_ABI void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
+ IntegerStyle Style);
+LLVM_ABI void write_integer(raw_ostream &S, int N, size_t MinDigits,
+ IntegerStyle Style);
LLVM_ABI void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
- IntegerStyle Style);
+ IntegerStyle Style);
LLVM_ABI void write_integer(raw_ostream &S, long N, size_t MinDigits,
- IntegerStyle Style);
-LLVM_ABI void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
- IntegerStyle Style);
+ IntegerStyle Style);
+LLVM_ABI void write_integer(raw_ostream &S, unsigned long long N,
+ size_t MinDigits, IntegerStyle Style);
LLVM_ABI void write_integer(raw_ostream &S, long long N, size_t MinDigits,
- IntegerStyle Style);
+ IntegerStyle Style);
LLVM_ABI void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
- std::optional<size_t> Width = std::nullopt);
+ std::optional<size_t> Width = std::nullopt);
LLVM_ABI void write_double(raw_ostream &S, double D, FloatStyle Style,
- std::optional<size_t> Precision = std::nullopt);
+ std::optional<size_t> Precision = std::nullopt);
}
#endif
diff --git a/llvm/include/llvm/Support/OptimizedStructLayout.h b/llvm/include/llvm/Support/OptimizedStructLayout.h
index 452abca2aa..8c11ae158d 100644
--- a/llvm/include/llvm/Support/OptimizedStructLayout.h
+++ b/llvm/include/llvm/Support/OptimizedStructLayout.h
@@ -137,7 +137,7 @@ struct OptimizedStructLayoutField {
/// alignment. Note that the total size is not rounded up to a multiple
/// of the required alignment; clients which require this can do so easily.
LLVM_ABI std::pair<uint64_t, Align> performOptimizedStructLayout(
- MutableArrayRef<OptimizedStructLayoutField> Fields);
+ MutableArrayRef<OptimizedStructLayoutField> Fields);
} // namespace llvm
diff --git a/llvm/include/llvm/Support/OptionStrCmp.h b/llvm/include/llvm/Support/OptionStrCmp.h
index 4dd3ef9772..4ac2452d44 100644
--- a/llvm/include/llvm/Support/OptionStrCmp.h
+++ b/llvm/include/llvm/Support/OptionStrCmp.h
@@ -22,11 +22,11 @@ namespace llvm {
// are identical ignoring case, they are ordered according to case sensitive
// ordering if `FallbackCaseSensitive` is true.
LLVM_ABI int StrCmpOptionName(StringRef A, StringRef B,
- bool FallbackCaseSensitive = true);
+ bool FallbackCaseSensitive = true);
// Comparison function for Option prefixes.
LLVM_ABI int StrCmpOptionPrefixes(ArrayRef<StringRef> APrefixes,
- ArrayRef<StringRef> BPrefixes);
+ ArrayRef<StringRef> BPrefixes);
} // namespace llvm
diff --git a/llvm/include/llvm/Support/Parallel.h b/llvm/include/llvm/Support/Parallel.h
index 0fb8ab45c7..3103390b0e 100644
--- a/llvm/include/llvm/Support/Parallel.h
+++ b/llvm/include/llvm/Support/Parallel.h
@@ -226,7 +226,8 @@ void parallelSort(RandomAccessIterator Start, RandomAccessIterator End,
llvm::sort(Start, End, Comp);
}
-LLVM_ABI void parallelFor(size_t Begin, size_t End, function_ref<void(size_t)> Fn);
+LLVM_ABI void parallelFor(size_t Begin, size_t End,
+ function_ref<void(size_t)> Fn);
template <class IterTy, class FuncTy>
void parallelForEach(IterTy Begin, IterTy End, FuncTy Fn) {
diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h
index f70405d3e7..6103b9cd58 100644
--- a/llvm/include/llvm/Support/Path.h
+++ b/llvm/include/llvm/Support/Path.h
@@ -153,7 +153,8 @@ LLVM_ABI reverse_iterator rend(StringRef path);
/// @endcode
///
/// @param path A path that is modified to not have a file component.
-LLVM_ABI void remove_filename(SmallVectorImpl<char> &path, Style style = Style::native);
+LLVM_ABI void remove_filename(SmallVectorImpl<char> &path,
+ Style style = Style::native);
/// Replace the file extension of \a path with \a extension.
///
@@ -167,8 +168,9 @@ LLVM_ABI void remove_filename(SmallVectorImpl<char> &path, Style style = Style::
/// @param extension The extension to be added. It may be empty. It may also
/// optionally start with a '.', if it does not, one will be
/// prepended.
-LLVM_ABI void replace_extension(SmallVectorImpl<char> &path, const Twine &extension,
- Style style = Style::native);
+LLVM_ABI void replace_extension(SmallVectorImpl<char> &path,
+ const Twine &extension,
+ Style style = Style::native);
/// Replace matching path prefix with another path.
///
@@ -192,15 +194,16 @@ LLVM_ABI void replace_extension(SmallVectorImpl<char> &path, const Twine &extens
/// @param style The style used to match the prefix. Exact match using
/// Posix style, case/separator insensitive match for Windows style.
/// @result true if \a Path begins with OldPrefix
-LLVM_ABI bool replace_path_prefix(SmallVectorImpl<char> &Path, StringRef OldPrefix,
- StringRef NewPrefix,
- Style style = Style::native);
+LLVM_ABI bool replace_path_prefix(SmallVectorImpl<char> &Path,
+ StringRef OldPrefix, StringRef NewPrefix,
+ Style style = Style::native);
/// Remove redundant leading "./" pieces and consecutive separators.
///
/// @param path Input path.
/// @result The cleaned-up \a path.
-LLVM_ABI StringRef remove_leading_dotslash(StringRef path, Style style = Style::native);
+LLVM_ABI StringRef remove_leading_dotslash(StringRef path,
+ Style style = Style::native);
/// In-place remove any './' and optionally '../' components from a path.
///
@@ -208,8 +211,9 @@ LLVM_ABI StringRef remove_leading_dotslash(StringRef path, Style style = Style::
/// @param remove_dot_dot specify if '../' (except for leading "../") should be
/// removed
/// @result True if path was changed
-LLVM_ABI bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
- Style style = Style::native);
+LLVM_ABI bool remove_dots(SmallVectorImpl<char> &path,
+ bool remove_dot_dot = false,
+ Style style = Style::native);
/// Append to path.
///
@@ -222,12 +226,12 @@ LLVM_ABI bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = fal
/// @param path Set to \a path + \a component.
/// @param a The component to be appended to \a path.
LLVM_ABI void append(SmallVectorImpl<char> &path, const Twine &a,
- const Twine &b = "",
- const Twine &c = "",
- const Twine &d = "");
+ const Twine &b = "", const Twine &c = "",
+ const Twine &d = "");
LLVM_ABI void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
- const Twine &b = "", const Twine &c = "", const Twine &d = "");
+ const Twine &b = "", const Twine &c = "",
+ const Twine &d = "");
/// Append to path.
///
@@ -241,7 +245,7 @@ LLVM_ABI void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
/// @param begin Start of components to append.
/// @param end One past the end of components to append.
LLVM_ABI void append(SmallVectorImpl<char> &path, const_iterator begin,
- const_iterator end, Style style = Style::native);
+ const_iterator end, Style style = Style::native);
/// @}
/// @name Transforms (or some other better name)
@@ -254,7 +258,7 @@ LLVM_ABI void append(SmallVectorImpl<char> &path, const_iterator begin,
/// @param path A path that is transformed to native format.
/// @param result Holds the result of the transformation.
LLVM_ABI void native(const Twine &path, SmallVectorImpl<char> &result,
- Style style = Style::native);
+ Style style = Style::native);
/// Convert path to the native form in place. This is used to give paths to
/// users and operating system calls in the platform's normal way. For example,
@@ -280,7 +284,8 @@ inline void make_preferred(SmallVectorImpl<char> &path,
/// @result The result of replacing backslashes with forward slashes if Windows.
/// On Unix, this function is a no-op because backslashes are valid path
/// chracters.
-LLVM_ABI std::string convert_to_slash(StringRef path, Style style = Style::native);
+LLVM_ABI std::string convert_to_slash(StringRef path,
+ Style style = Style::native);
/// @}
/// @name Lexical Observers
@@ -411,7 +416,8 @@ LLVM_ABI StringRef get_separator(Style style = Style::native);
/// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
///
/// @param result Holds the resulting path name.
-LLVM_ABI void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
+LLVM_ABI void system_temp_directory(bool erasedOnReboot,
+ SmallVectorImpl<char> &result);
/// Get the user's home directory.
///
@@ -447,7 +453,8 @@ LLVM_ABI bool has_root_name(const Twine &path, Style style = Style::native);
///
/// @param path Input path.
/// @result True if the path has a root directory, false otherwise.
-LLVM_ABI bool has_root_directory(const Twine &path, Style style = Style::native);
+LLVM_ABI bool has_root_directory(const Twine &path,
+ Style style = Style::native);
/// Has root path?
///
diff --git a/llvm/include/llvm/Support/PluginLoader.h b/llvm/include/llvm/Support/PluginLoader.h
index 0db6817309..54643ca30a 100644
--- a/llvm/include/llvm/Support/PluginLoader.h
+++ b/llvm/include/llvm/Support/PluginLoader.h
@@ -24,11 +24,11 @@
#include <string>
namespace llvm {
- struct LLVM_ABI PluginLoader {
- void operator=(const std::string &Filename);
- static unsigned getNumPlugins();
- static std::string& getPlugin(unsigned num);
- };
+struct LLVM_ABI PluginLoader {
+ void operator=(const std::string &Filename);
+ static unsigned getNumPlugins();
+ static std::string &getPlugin(unsigned num);
+};
#ifndef DONT_GET_PLUGIN_LOADER_OPTION
// This causes operator= above to be invoked for every -load option.
diff --git a/llvm/include/llvm/Support/PrettyStackTrace.h b/llvm/include/llvm/Support/PrettyStackTrace.h
index a757d1c374..1ab3b7b50c 100644
--- a/llvm/include/llvm/Support/PrettyStackTrace.h
+++ b/llvm/include/llvm/Support/PrettyStackTrace.h
@@ -35,7 +35,8 @@ namespace llvm {
///
/// \see EnablePrettyStackTrace
/// \see PrettyStackTraceEntry
- LLVM_ABI void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
+ LLVM_ABI void
+ EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
/// Replaces the generic bug report message that is output upon
/// a crash.
@@ -50,7 +51,8 @@ namespace llvm {
/// constructed and destructed, they will add their symbolic frames to a
/// virtual stack trace. This gets dumped out if the program crashes.
class LLVM_ABI PrettyStackTraceEntry {
- friend LLVM_ABI PrettyStackTraceEntry *ReverseStackTrace(PrettyStackTraceEntry *);
+ friend LLVM_ABI PrettyStackTraceEntry *
+ ReverseStackTrace(PrettyStackTraceEntry *);
PrettyStackTraceEntry *NextEntry;
PrettyStackTraceEntry(const PrettyStackTraceEntry &) = delete;
diff --git a/llvm/include/llvm/Support/Process.h b/llvm/include/llvm/Support/Process.h
index b7f86b1669..d2e630c056 100644
--- a/llvm/include/llvm/Support/Process.h
+++ b/llvm/include/llvm/Support/Process.h
@@ -219,7 +219,6 @@ public:
private:
[[noreturn]] static void ExitNoCleanup(int RetCode);
};
-
}
}
diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h
index ce539643f0..62f03342d2 100644
--- a/llvm/include/llvm/Support/Program.h
+++ b/llvm/include/llvm/Support/Program.h
@@ -161,12 +161,12 @@ namespace sys {
/// Return true if the given arguments fit within system-specific
/// argument length limits.
LLVM_ABI bool commandLineFitsWithinSystemLimits(StringRef Program,
- ArrayRef<StringRef> Args);
+ ArrayRef<StringRef> Args);
/// Return true if the given arguments fit within system-specific
/// argument length limits.
LLVM_ABI bool commandLineFitsWithinSystemLimits(StringRef Program,
- ArrayRef<const char *> Args);
+ ArrayRef<const char *> Args);
/// File encoding options when writing contents that a non-UTF8 tool will
/// read (on Windows systems). For UNIX, we always use UTF-8.
@@ -209,27 +209,27 @@ namespace sys {
/// \li 0 if the child process has not changed state.
/// \note Users of this function should always check the ReturnCode member of
/// the \see ProcessInfo returned from this function.
- LLVM_ABI ProcessInfo
- Wait(const ProcessInfo &PI, ///< The child process that should be waited on.
- std::optional<unsigned> SecondsToWait, ///< If std::nullopt, waits until
- ///< child has terminated.
- ///< If a value, this specifies the amount of time to wait for the child
- ///< process. If the time expires, and \p Polling is false, the child is
- ///< killed and this < function returns. If the time expires and \p
- ///< Polling is true, the child is resumed.
- ///<
- ///< If zero, this function will perform a non-blocking
- ///< wait on the child process.
- std::string *ErrMsg = nullptr, ///< If non-zero, provides a pointer to a
- ///< string instance in which error messages will be returned. If the
- ///< string is non-empty upon return an error occurred while invoking the
- ///< program.
- std::optional<ProcessStatistics> *ProcStat =
- nullptr, ///< If non-zero, provides
- /// a pointer to a structure in which process execution statistics will
- /// be stored.
-
- bool Polling = false ///< If true, do not kill the process on timeout.
+ LLVM_ABI ProcessInfo Wait(
+ const ProcessInfo &PI, ///< The child process that should be waited on.
+ std::optional<unsigned> SecondsToWait, ///< If std::nullopt, waits until
+ ///< child has terminated.
+ ///< If a value, this specifies the amount of time to wait for the child
+ ///< process. If the time expires, and \p Polling is false, the child is
+ ///< killed and this < function returns. If the time expires and \p
+ ///< Polling is true, the child is resumed.
+ ///<
+ ///< If zero, this function will perform a non-blocking
+ ///< wait on the child process.
+ std::string *ErrMsg = nullptr, ///< If non-zero, provides a pointer to a
+ ///< string instance in which error messages will be returned. If the
+ ///< string is non-empty upon return an error occurred while invoking the
+ ///< program.
+ std::optional<ProcessStatistics> *ProcStat =
+ nullptr, ///< If non-zero, provides
+ /// a pointer to a structure in which process execution statistics will
+ /// be stored.
+
+ bool Polling = false ///< If true, do not kill the process on timeout.
);
/// Print a command argument, and optionally quote it.
@@ -240,7 +240,8 @@ namespace sys {
/// to build a single flat command line appropriate for calling CreateProcess
/// on
/// Windows.
- LLVM_ABI ErrorOr<std::wstring> flattenWindowsCommandLine(ArrayRef<StringRef> Args);
+ LLVM_ABI ErrorOr<std::wstring>
+ flattenWindowsCommandLine(ArrayRef<StringRef> Args);
#endif
}
}
diff --git a/llvm/include/llvm/Support/Recycler.h b/llvm/include/llvm/Support/Recycler.h
index e2548cc7c5..187db31f4e 100644
--- a/llvm/include/llvm/Support/Recycler.h
+++ b/llvm/include/llvm/Support/Recycler.h
@@ -25,7 +25,8 @@ namespace llvm {
/// PrintRecyclingAllocatorStats - Helper for RecyclingAllocator for
/// printing statistics.
///
-LLVM_ABI void PrintRecyclerStats(size_t Size, size_t Align, size_t FreeListSize);
+LLVM_ABI void PrintRecyclerStats(size_t Size, size_t Align,
+ size_t FreeListSize);
/// Recycler - This class manages a linked-list of deallocated nodes
/// and facilitates reusing deallocated memory in place of allocating
diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h
index 7c1765582b..b1460c7210 100644
--- a/llvm/include/llvm/Support/ScaledNumber.h
+++ b/llvm/include/llvm/Support/ScaledNumber.h
@@ -136,14 +136,16 @@ inline std::pair<uint64_t, int16_t> getProduct64(uint64_t LHS, uint64_t RHS) {
/// Implemented with long division.
///
/// \pre \c Dividend and \c Divisor are non-zero.
-LLVM_ABI std::pair<uint64_t, int16_t> divide64(uint64_t Dividend, uint64_t Divisor);
+LLVM_ABI std::pair<uint64_t, int16_t> divide64(uint64_t Dividend,
+ uint64_t Divisor);
/// Divide two 32-bit integers to create a 32-bit scaled number.
///
/// Implemented with one 64-bit integer divide/remainder pair.
///
/// \pre \c Dividend and \c Divisor are non-zero.
-LLVM_ABI std::pair<uint32_t, int16_t> divide32(uint32_t Dividend, uint32_t Divisor);
+LLVM_ABI std::pair<uint32_t, int16_t> divide32(uint32_t Dividend,
+ uint32_t Divisor);
/// Divide two 32-bit numbers to create a 32-bit scaled number.
///
diff --git a/llvm/include/llvm/Support/Signals.h b/llvm/include/llvm/Support/Signals.h
index 41b2ea1584..7aaae11f46 100644
--- a/llvm/include/llvm/Support/Signals.h
+++ b/llvm/include/llvm/Support/Signals.h
@@ -26,92 +26,93 @@ namespace sys {
/// This function runs all the registered interrupt handlers, including the
/// removal of files registered by RemoveFileOnSignal.
- LLVM_ABI void RunInterruptHandlers();
-
- /// This function registers signal handlers to ensure that if a signal gets
- /// delivered that the named file is removed.
- /// Remove a file if a fatal signal occurs.
- LLVM_ABI bool RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg = nullptr);
-
- /// This function removes a file from the list of files to be removed on
- /// signal delivery.
- LLVM_ABI void DontRemoveFileOnSignal(StringRef Filename);
-
- /// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
- /// process, print a stack trace and then exit.
- /// Print a stack trace if a fatal signal occurs.
- /// \param Argv0 the current binary name, used to find the symbolizer
- /// relative to the current binary before searching $PATH; can be
- /// StringRef(), in which case we will only search $PATH.
- /// \param DisableCrashReporting if \c true, disable the normal crash
- /// reporting mechanisms on the underlying operating system.
- LLVM_ABI void PrintStackTraceOnErrorSignal(StringRef Argv0,
- bool DisableCrashReporting = false);
-
- /// Disable all system dialog boxes that appear when the process crashes.
- LLVM_ABI void DisableSystemDialogsOnCrash();
-
- /// Print the stack trace using the given \c raw_ostream object.
- /// \param Depth refers to the number of stackframes to print. If not
- /// specified, the entire frame is printed.
- LLVM_ABI void PrintStackTrace(raw_ostream &OS, int Depth = 0);
-
- // Run all registered signal handlers.
- LLVM_ABI void RunSignalHandlers();
-
- using SignalHandlerCallback = void (*)(void *);
-
- /// Add a function to be called when an abort/kill signal is delivered to the
- /// process. The handler can have a cookie passed to it to identify what
- /// instance of the handler it is.
- LLVM_ABI void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie);
-
- /// This function registers a function to be called when the user "interrupts"
- /// the program (typically by pressing ctrl-c). When the user interrupts the
- /// program, the specified interrupt function is called instead of the program
- /// being killed, and the interrupt function automatically disabled.
- ///
- /// Note that interrupt functions are not allowed to call any non-reentrant
- /// functions. An null interrupt function pointer disables the current
- /// installed function. Note also that the handler may be executed on a
- /// different thread on some platforms.
- LLVM_ABI void SetInterruptFunction(void (*IF)());
-
- /// Registers a function to be called when an "info" signal is delivered to
- /// the process.
- ///
- /// On POSIX systems, this will be SIGUSR1; on systems that have it, SIGINFO
- /// will also be used (typically ctrl-t).
- ///
- /// Note that signal handlers are not allowed to call any non-reentrant
- /// functions. An null function pointer disables the current installed
- /// function. Note also that the handler may be executed on a different
- /// thread on some platforms.
- LLVM_ABI void SetInfoSignalFunction(void (*Handler)());
-
- /// Registers a function to be called in a "one-shot" manner when a pipe
- /// signal is delivered to the process (i.e., on a failed write to a pipe).
- /// After the pipe signal is handled once, the handler is unregistered.
- ///
- /// The LLVM signal handling code will not install any handler for the pipe
- /// signal unless one is provided with this API (see \ref
- /// DefaultOneShotPipeSignalHandler). This handler must be provided before
- /// any other LLVM signal handlers are installed: the \ref InitLLVM
- /// constructor has a flag that can simplify this setup.
- ///
- /// Note that the handler is not allowed to call any non-reentrant
- /// functions. A null handler pointer disables the current installed
- /// function. Note also that the handler may be executed on a
- /// different thread on some platforms.
- LLVM_ABI void SetOneShotPipeSignalFunction(void (*Handler)());
-
- /// On Unix systems and Windows, this function exits with an "IO error" exit
- /// code.
- LLVM_ABI void DefaultOneShotPipeSignalHandler();
+LLVM_ABI void RunInterruptHandlers();
+
+/// This function registers signal handlers to ensure that if a signal gets
+/// delivered that the named file is removed.
+/// Remove a file if a fatal signal occurs.
+LLVM_ABI bool RemoveFileOnSignal(StringRef Filename,
+ std::string *ErrMsg = nullptr);
+
+/// This function removes a file from the list of files to be removed on
+/// signal delivery.
+LLVM_ABI void DontRemoveFileOnSignal(StringRef Filename);
+
+/// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
+/// process, print a stack trace and then exit.
+/// Print a stack trace if a fatal signal occurs.
+/// \param Argv0 the current binary name, used to find the symbolizer
+/// relative to the current binary before searching $PATH; can be
+/// StringRef(), in which case we will only search $PATH.
+/// \param DisableCrashReporting if \c true, disable the normal crash
+/// reporting mechanisms on the underlying operating system.
+LLVM_ABI void PrintStackTraceOnErrorSignal(StringRef Argv0,
+ bool DisableCrashReporting = false);
+
+/// Disable all system dialog boxes that appear when the process crashes.
+LLVM_ABI void DisableSystemDialogsOnCrash();
+
+/// Print the stack trace using the given \c raw_ostream object.
+/// \param Depth refers to the number of stackframes to print. If not
+/// specified, the entire frame is printed.
+LLVM_ABI void PrintStackTrace(raw_ostream &OS, int Depth = 0);
+
+// Run all registered signal handlers.
+LLVM_ABI void RunSignalHandlers();
+
+using SignalHandlerCallback = void (*)(void *);
+
+/// Add a function to be called when an abort/kill signal is delivered to the
+/// process. The handler can have a cookie passed to it to identify what
+/// instance of the handler it is.
+LLVM_ABI void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie);
+
+/// This function registers a function to be called when the user "interrupts"
+/// the program (typically by pressing ctrl-c). When the user interrupts the
+/// program, the specified interrupt function is called instead of the program
+/// being killed, and the interrupt function automatically disabled.
+///
+/// Note that interrupt functions are not allowed to call any non-reentrant
+/// functions. An null interrupt function pointer disables the current
+/// installed function. Note also that the handler may be executed on a
+/// different thread on some platforms.
+LLVM_ABI void SetInterruptFunction(void (*IF)());
+
+/// Registers a function to be called when an "info" signal is delivered to
+/// the process.
+///
+/// On POSIX systems, this will be SIGUSR1; on systems that have it, SIGINFO
+/// will also be used (typically ctrl-t).
+///
+/// Note that signal handlers are not allowed to call any non-reentrant
+/// functions. An null function pointer disables the current installed
+/// function. Note also that the handler may be executed on a different
+/// thread on some platforms.
+LLVM_ABI void SetInfoSignalFunction(void (*Handler)());
+
+/// Registers a function to be called in a "one-shot" manner when a pipe
+/// signal is delivered to the process (i.e., on a failed write to a pipe).
+/// After the pipe signal is handled once, the handler is unregistered.
+///
+/// The LLVM signal handling code will not install any handler for the pipe
+/// signal unless one is provided with this API (see \ref
+/// DefaultOneShotPipeSignalHandler). This handler must be provided before
+/// any other LLVM signal handlers are installed: the \ref InitLLVM
+/// constructor has a flag that can simplify this setup.
+///
+/// Note that the handler is not allowed to call any non-reentrant
+/// functions. A null handler pointer disables the current installed
+/// function. Note also that the handler may be executed on a
+/// different thread on some platforms.
+LLVM_ABI void SetOneShotPipeSignalFunction(void (*Handler)());
+
+/// On Unix systems and Windows, this function exits with an "IO error" exit
+/// code.
+LLVM_ABI void DefaultOneShotPipeSignalHandler();
#ifdef _WIN32
/// Windows does not support signals and this handler must be called manually.
- LLVM_ABI void CallOneShotPipeSignalHandler();
+LLVM_ABI void CallOneShotPipeSignalHandler();
#endif
/// This function does the following:
@@ -121,9 +122,9 @@ namespace sys {
/// - create a core/mini dump of the exception context whenever possible
/// Context is a system-specific failure context: it is the signal type on
/// Unix; the ExceptionContext on Windows.
- LLVM_ABI void CleanupOnSignal(uintptr_t Context);
+LLVM_ABI void CleanupOnSignal(uintptr_t Context);
- LLVM_ABI void unregisterHandlers();
+LLVM_ABI void unregisterHandlers();
} // End sys namespace
} // End llvm namespace
diff --git a/llvm/include/llvm/Support/SipHash.h b/llvm/include/llvm/Support/SipHash.h
index 5f202d5cac..910cf59432 100644
--- a/llvm/include/llvm/Support/SipHash.h
+++ b/llvm/include/llvm/Support/SipHash.h
@@ -27,11 +27,11 @@ class StringRef;
/// Computes a SipHash-2-4 64-bit result.
LLVM_ABI void getSipHash_2_4_64(ArrayRef<uint8_t> In, const uint8_t (&K)[16],
- uint8_t (&Out)[8]);
+ uint8_t (&Out)[8]);
/// Computes a SipHash-2-4 128-bit result.
LLVM_ABI void getSipHash_2_4_128(ArrayRef<uint8_t> In, const uint8_t (&K)[16],
- uint8_t (&Out)[16]);
+ uint8_t (&Out)[16]);
/// Compute a stable non-zero 16-bit hash of the given string.
///
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
index f85865023a..9d65f1ec1e 100644
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -117,8 +117,8 @@ struct TimeTraceProfilerEntry;
/// This sets up the global \p TimeTraceProfilerInstance
/// variable to be the profiler instance.
LLVM_ABI void timeTraceProfilerInitialize(unsigned TimeTraceGranularity,
- StringRef ProcName,
- bool TimeTraceVerbose = false);
+ StringRef ProcName,
+ bool TimeTraceVerbose = false);
/// Cleanup the time trace profiler, if it was initialized.
LLVM_ABI void timeTraceProfilerCleanup();
@@ -142,14 +142,14 @@ LLVM_ABI void timeTraceProfilerWrite(raw_pwrite_stream &OS);
/// Returns a StringError indicating a failure if the function is
/// unable to open the file for writing.
LLVM_ABI Error timeTraceProfilerWrite(StringRef PreferredFileName,
- StringRef FallbackFileName);
+ StringRef FallbackFileName);
/// Manually begin a time section, with the given \p Name and \p Detail.
/// Profiler copies the string data, so the pointers can be given into
/// temporaries. Time sections can be hierarchical; every Begin must have a
/// matching End pair but they can nest.
LLVM_ABI TimeTraceProfilerEntry *timeTraceProfilerBegin(StringRef Name,
- StringRef Detail);
+ StringRef Detail);
LLVM_ABI TimeTraceProfilerEntry *
timeTraceProfilerBegin(StringRef Name,
llvm::function_ref<std::string()> Detail);
@@ -164,11 +164,12 @@ timeTraceProfilerBegin(StringRef Name,
/// https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#heading=h.jh64i9l3vwa1
/// for more details.
LLVM_ABI TimeTraceProfilerEntry *timeTraceAsyncProfilerBegin(StringRef Name,
- StringRef Detail);
+ StringRef Detail);
// Mark an instant event.
-LLVM_ABI void timeTraceAddInstantEvent(StringRef Name,
- llvm::function_ref<std::string()> Detail);
+LLVM_ABI void
+timeTraceAddInstantEvent(StringRef Name,
+ llvm::function_ref<std::string()> Detail);
/// Manually end the last time section.
LLVM_ABI void timeTraceProfilerEnd();
diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index 266c498cd5..b0be064f38 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -332,7 +332,8 @@ public:
// Stores the size of a type. If the type is of fixed size, it will represent
// the exact size. If the type is a scalable vector, it will represent the known
// minimum size.
-class LLVM_ABI TypeSize : public details::FixedOrScalableQuantity<TypeSize, uint64_t> {
+class LLVM_ABI TypeSize
+ : public details::FixedOrScalableQuantity<TypeSize, uint64_t> {
TypeSize(const FixedOrScalableQuantity<TypeSize, uint64_t> &V)
: FixedOrScalableQuantity(V) {}
diff --git a/llvm/include/llvm/Support/Unicode.h b/llvm/include/llvm/Support/Unicode.h
index 9b3a42932c..7c790da7b6 100644
--- a/llvm/include/llvm/Support/Unicode.h
+++ b/llvm/include/llvm/Support/Unicode.h
@@ -75,7 +75,8 @@ struct LooseMatchingResult {
SmallString<64> Name;
};
-LLVM_ABI std::optional<LooseMatchingResult> nameToCodepointLooseMatching(StringRef Name);
+LLVM_ABI std::optional<LooseMatchingResult>
+nameToCodepointLooseMatching(StringRef Name);
struct MatchForCodepointName {
std::string Name;
diff --git a/llvm/include/llvm/Support/Valgrind.h b/llvm/include/llvm/Support/Valgrind.h
index a3c490c729..894ddecf0b 100644
--- a/llvm/include/llvm/Support/Valgrind.h
+++ b/llvm/include/llvm/Support/Valgrind.h
@@ -21,11 +21,11 @@
namespace llvm {
namespace sys {
// True if Valgrind is controlling this process.
- LLVM_ABI bool RunningOnValgrind();
+LLVM_ABI bool RunningOnValgrind();
- // Discard valgrind's translation of code in the range [Addr .. Addr + Len).
- // Otherwise valgrind may continue to execute the old version of the code.
- LLVM_ABI void ValgrindDiscardTranslations(const void *Addr, size_t Len);
+// Discard valgrind's translation of code in the range [Addr .. Addr + Len).
+// Otherwise valgrind may continue to execute the old version of the code.
+LLVM_ABI void ValgrindDiscardTranslations(const void *Addr, size_t Len);
} // namespace sys
} // end namespace llvm
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index 7accdc7993..78acd5b805 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -264,7 +264,7 @@ public:
/// The virtual file system interface.
class LLVM_ABI FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem>,
- public RTTIExtends<FileSystem, RTTIRoot> {
+ public RTTIExtends<FileSystem, RTTIRoot> {
public:
static const char ID;
virtual ~FileSystem();
@@ -376,7 +376,8 @@ LLVM_ABI std::unique_ptr<FileSystem> createPhysicalFileSystem();
/// top-most (most recently added) directory are used. When there is a file
/// that exists in more than one file system, the file in the top-most file
/// system overrides the other(s).
-class LLVM_ABI OverlayFileSystem : public RTTIExtends<OverlayFileSystem, FileSystem> {
+class LLVM_ABI OverlayFileSystem
+ : public RTTIExtends<OverlayFileSystem, FileSystem> {
using FileSystemList = SmallVector<IntrusiveRefCntPtr<FileSystem>, 1>;
/// The stack of file systems, implemented as a list in order of
@@ -436,7 +437,8 @@ protected:
/// By default, this delegates all calls to the underlying file system. This
/// is useful when derived file systems want to override some calls and still
/// proxy other calls.
-class LLVM_ABI ProxyFileSystem : public RTTIExtends<ProxyFileSystem, FileSystem> {
+class LLVM_ABI ProxyFileSystem
+ : public RTTIExtends<ProxyFileSystem, FileSystem> {
public:
static const char ID;
explicit ProxyFileSystem(IntrusiveRefCntPtr<FileSystem> FS)
@@ -522,7 +524,8 @@ public:
} // namespace detail
/// An in-memory file system.
-class LLVM_ABI InMemoryFileSystem : public RTTIExtends<InMemoryFileSystem, FileSystem> {
+class LLVM_ABI InMemoryFileSystem
+ : public RTTIExtends<InMemoryFileSystem, FileSystem> {
std::unique_ptr<detail::InMemoryDirectory> Root;
std::string WorkingDirectory;
bool UseNormalizedPaths = true;
diff --git a/llvm/include/llvm/Support/Watchdog.h b/llvm/include/llvm/Support/Watchdog.h
index 080edb3bd6..768bb3fb3a 100644
--- a/llvm/include/llvm/Support/Watchdog.h
+++ b/llvm/include/llvm/Support/Watchdog.h
@@ -22,15 +22,16 @@ namespace llvm {
/// that must complete in a given amount of time. Failure to complete before
/// the timeout is an unrecoverable situation and no mechanisms to attempt
/// to handle it are provided.
- class LLVM_ABI Watchdog {
- public:
- Watchdog(unsigned int seconds);
- ~Watchdog();
- private:
- // Noncopyable.
- Watchdog(const Watchdog &other) = delete;
- Watchdog &operator=(const Watchdog &other) = delete;
- };
+ class LLVM_ABI Watchdog {
+ public:
+ Watchdog(unsigned int seconds);
+ ~Watchdog();
+
+ private:
+ // Noncopyable.
+ Watchdog(const Watchdog &other) = delete;
+ Watchdog &operator=(const Watchdog &other) = delete;
+ };
}
}
diff --git a/llvm/include/llvm/Support/Windows/WindowsSupport.h b/llvm/include/llvm/Support/Windows/WindowsSupport.h
index beca3e196a..ffc6fdf5b9 100644
--- a/llvm/include/llvm/Support/Windows/WindowsSupport.h
+++ b/llvm/include/llvm/Support/Windows/WindowsSupport.h
@@ -235,13 +235,15 @@ namespace windows {
// Returns command line arguments. Unlike arguments given to main(),
// this function guarantees that the returned arguments are encoded in
// UTF-8 regardless of the current code page setting.
-LLVM_ABI std::error_code GetCommandLineArguments(SmallVectorImpl<const char *> &Args,
- BumpPtrAllocator &Alloc);
+LLVM_ABI std::error_code
+GetCommandLineArguments(SmallVectorImpl<const char *> &Args,
+ BumpPtrAllocator &Alloc);
/// Convert UTF-8 path to a suitable UTF-16 path for use with the Win32 Unicode
/// File API.
-LLVM_ABI std::error_code widenPath(const Twine &Path8, SmallVectorImpl<wchar_t> &Path16,
- size_t MaxPathLen = MAX_PATH);
+LLVM_ABI std::error_code widenPath(const Twine &Path8,
+ SmallVectorImpl<wchar_t> &Path16,
+ size_t MaxPathLen = MAX_PATH);
} // end namespace windows
} // end namespace sys
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index 2347498618..24fa6c8b03 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -1202,92 +1202,79 @@ yamlize(IO &io, T &Seq, bool, Context &Ctx) {
}
}
-template<>
-struct LLVM_ABI ScalarTraits<bool> {
+template <> struct LLVM_ABI ScalarTraits<bool> {
static void output(const bool &, void* , raw_ostream &);
static StringRef input(StringRef, void *, bool &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<StringRef> {
+template <> struct LLVM_ABI ScalarTraits<StringRef> {
static void output(const StringRef &, void *, raw_ostream &);
static StringRef input(StringRef, void *, StringRef &);
static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
};
-template<>
-struct LLVM_ABI ScalarTraits<std::string> {
+template <> struct LLVM_ABI ScalarTraits<std::string> {
static void output(const std::string &, void *, raw_ostream &);
static StringRef input(StringRef, void *, std::string &);
static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
};
-template<>
-struct LLVM_ABI ScalarTraits<uint8_t> {
+template <> struct LLVM_ABI ScalarTraits<uint8_t> {
static void output(const uint8_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, uint8_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<uint16_t> {
+template <> struct LLVM_ABI ScalarTraits<uint16_t> {
static void output(const uint16_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, uint16_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<uint32_t> {
+template <> struct LLVM_ABI ScalarTraits<uint32_t> {
static void output(const uint32_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, uint32_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<uint64_t> {
+template <> struct LLVM_ABI ScalarTraits<uint64_t> {
static void output(const uint64_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, uint64_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<int8_t> {
+template <> struct LLVM_ABI ScalarTraits<int8_t> {
static void output(const int8_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, int8_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<int16_t> {
+template <> struct LLVM_ABI ScalarTraits<int16_t> {
static void output(const int16_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, int16_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<int32_t> {
+template <> struct LLVM_ABI ScalarTraits<int32_t> {
static void output(const int32_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, int32_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<int64_t> {
+template <> struct LLVM_ABI ScalarTraits<int64_t> {
static void output(const int64_t &, void *, raw_ostream &);
static StringRef input(StringRef, void *, int64_t &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<float> {
+template <> struct LLVM_ABI ScalarTraits<float> {
static void output(const float &, void *, raw_ostream &);
static StringRef input(StringRef, void *, float &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<double> {
+template <> struct LLVM_ABI ScalarTraits<double> {
static void output(const double &, void *, raw_ostream &);
static StringRef input(StringRef, void *, double &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
@@ -1747,29 +1734,25 @@ LLVM_YAML_STRONG_TYPEDEF(uint16_t, Hex16)
LLVM_YAML_STRONG_TYPEDEF(uint32_t, Hex32)
LLVM_YAML_STRONG_TYPEDEF(uint64_t, Hex64)
-template<>
-struct LLVM_ABI ScalarTraits<Hex8> {
+template <> struct LLVM_ABI ScalarTraits<Hex8> {
static void output(const Hex8 &, void *, raw_ostream &);
static StringRef input(StringRef, void *, Hex8 &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<Hex16> {
+template <> struct LLVM_ABI ScalarTraits<Hex16> {
static void output(const Hex16 &, void *, raw_ostream &);
static StringRef input(StringRef, void *, Hex16 &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<Hex32> {
+template <> struct LLVM_ABI ScalarTraits<Hex32> {
static void output(const Hex32 &, void *, raw_ostream &);
static StringRef input(StringRef, void *, Hex32 &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
};
-template<>
-struct LLVM_ABI ScalarTraits<Hex64> {
+template <> struct LLVM_ABI ScalarTraits<Hex64> {
static void output(const Hex64 &, void *, raw_ostream &);
static StringRef input(StringRef, void *, Hex64 &);
static QuotingType mustQuote(StringRef) { return QuotingType::None; }
diff --git a/llvm/include/llvm/Support/circular_raw_ostream.h b/llvm/include/llvm/Support/circular_raw_ostream.h
index 7ecf6b75ca..80155b3fbd 100644
--- a/llvm/include/llvm/Support/circular_raw_ostream.h
+++ b/llvm/include/llvm/Support/circular_raw_ostream.h
@@ -22,138 +22,136 @@ namespace llvm {
/// to a circular buffer, or can pass it through directly to an
/// underlying stream if specified with a buffer of zero.
///
- class LLVM_ABI circular_raw_ostream : public raw_ostream {
- public:
- /// TAKE_OWNERSHIP - Tell this stream that it owns the underlying
- /// stream and is responsible for cleanup, memory management
- /// issues, etc.
- ///
- static constexpr bool TAKE_OWNERSHIP = true;
-
- /// REFERENCE_ONLY - Tell this stream it should not manage the
- /// held stream.
- ///
- static constexpr bool REFERENCE_ONLY = false;
-
- private:
- /// TheStream - The real stream we output to. We set it to be
- /// unbuffered, since we're already doing our own buffering.
- ///
- raw_ostream *TheStream = nullptr;
-
- /// OwnsStream - Are we responsible for managing the underlying
- /// stream?
- ///
- bool OwnsStream;
-
- /// BufferSize - The size of the buffer in bytes.
- ///
- size_t BufferSize;
-
- /// BufferArray - The actual buffer storage.
- ///
- char *BufferArray = nullptr;
-
- /// Cur - Pointer to the current output point in BufferArray.
- ///
- char *Cur;
-
- /// Filled - Indicate whether the buffer has been completely
- /// filled. This helps avoid garbage output.
- ///
- bool Filled = false;
-
- /// Banner - A pointer to a banner to print before dumping the
- /// log.
- ///
- const char *Banner;
-
- /// flushBuffer - Dump the contents of the buffer to Stream.
- ///
- void flushBuffer() {
- if (Filled)
- // Write the older portion of the buffer.
- TheStream->write(Cur, BufferArray + BufferSize - Cur);
- // Write the newer portion of the buffer.
- TheStream->write(BufferArray, Cur - BufferArray);
- Cur = BufferArray;
- Filled = false;
- }
-
- void write_impl(const char *Ptr, size_t Size) override;
-
- /// current_pos - Return the current position within the stream,
- /// not counting the bytes currently in the buffer.
- ///
- uint64_t current_pos() const override {
- // This has the same effect as calling TheStream.current_pos(),
- // but that interface is private.
- return TheStream->tell() - TheStream->GetNumBytesInBuffer();
- }
-
- public:
- /// circular_raw_ostream - Construct an optionally
- /// circular-buffered stream, handing it an underlying stream to
- /// do the "real" output.
- ///
- /// As a side effect, if BuffSize is nonzero, the given Stream is
- /// set to be Unbuffered. This is because circular_raw_ostream
- /// does its own buffering, so it doesn't want another layer of
- /// buffering to be happening underneath it.
- ///
- /// "Owns" tells the circular_raw_ostream whether it is
- /// responsible for managing the held stream, doing memory
- /// management of it, etc.
- ///
- circular_raw_ostream(raw_ostream &Stream, const char *Header,
- size_t BuffSize = 0, bool Owns = REFERENCE_ONLY)
- : raw_ostream(/*unbuffered*/ true), OwnsStream(Owns),
- BufferSize(BuffSize), Banner(Header) {
- if (BufferSize != 0)
- BufferArray = new char[BufferSize];
- Cur = BufferArray;
- setStream(Stream, Owns);
- }
-
- ~circular_raw_ostream() override {
- flush();
- flushBufferWithBanner();
- releaseStream();
- delete[] BufferArray;
- }
-
- bool is_displayed() const override {
- return TheStream->is_displayed();
- }
-
- /// setStream - Tell the circular_raw_ostream to output a
- /// different stream. "Owns" tells circular_raw_ostream whether
- /// it should take responsibility for managing the underlying
- /// stream.
- ///
- void setStream(raw_ostream &Stream, bool Owns = REFERENCE_ONLY) {
- releaseStream();
- TheStream = &Stream;
- OwnsStream = Owns;
- }
-
- /// flushBufferWithBanner - Force output of the buffer along with
- /// a small header.
- ///
- void flushBufferWithBanner();
-
- private:
- /// releaseStream - Delete the held stream if needed. Otherwise,
- /// transfer the buffer settings from this circular_raw_ostream
- /// back to the underlying stream.
- ///
- void releaseStream() {
- if (!TheStream)
- return;
- if (OwnsStream)
- delete TheStream;
- }
- };
+class LLVM_ABI circular_raw_ostream : public raw_ostream {
+public:
+ /// TAKE_OWNERSHIP - Tell this stream that it owns the underlying
+ /// stream and is responsible for cleanup, memory management
+ /// issues, etc.
+ ///
+ static constexpr bool TAKE_OWNERSHIP = true;
+
+ /// REFERENCE_ONLY - Tell this stream it should not manage the
+ /// held stream.
+ ///
+ static constexpr bool REFERENCE_ONLY = false;
+
+private:
+ /// TheStream - The real stream we output to. We set it to be
+ /// unbuffered, since we're already doing our own buffering.
+ ///
+ raw_ostream *TheStream = nullptr;
+
+ /// OwnsStream - Are we responsible for managing the underlying
+ /// stream?
+ ///
+ bool OwnsStream;
+
+ /// BufferSize - The size of the buffer in bytes.
+ ///
+ size_t BufferSize;
+
+ /// BufferArray - The actual buffer storage.
+ ///
+ char *BufferArray = nullptr;
+
+ /// Cur - Pointer to the current output point in BufferArray.
+ ///
+ char *Cur;
+
+ /// Filled - Indicate whether the buffer has been completely
+ /// filled. This helps avoid garbage output.
+ ///
+ bool Filled = false;
+
+ /// Banner - A pointer to a banner to print before dumping the
+ /// log.
+ ///
+ const char *Banner;
+
+ /// flushBuffer - Dump the contents of the buffer to Stream.
+ ///
+ void flushBuffer() {
+ if (Filled)
+ // Write the older portion of the buffer.
+ TheStream->write(Cur, BufferArray + BufferSize - Cur);
+ // Write the newer portion of the buffer.
+ TheStream->write(BufferArray, Cur - BufferArray);
+ Cur = BufferArray;
+ Filled = false;
+ }
+
+ void write_impl(const char *Ptr, size_t Size) override;
+
+ /// current_pos - Return the current position within the stream,
+ /// not counting the bytes currently in the buffer.
+ ///
+ uint64_t current_pos() const override {
+ // This has the same effect as calling TheStream.current_pos(),
+ // but that interface is private.
+ return TheStream->tell() - TheStream->GetNumBytesInBuffer();
+ }
+
+public:
+ /// circular_raw_ostream - Construct an optionally
+ /// circular-buffered stream, handing it an underlying stream to
+ /// do the "real" output.
+ ///
+ /// As a side effect, if BuffSize is nonzero, the given Stream is
+ /// set to be Unbuffered. This is because circular_raw_ostream
+ /// does its own buffering, so it doesn't want another layer of
+ /// buffering to be happening underneath it.
+ ///
+ /// "Owns" tells the circular_raw_ostream whether it is
+ /// responsible for managing the held stream, doing memory
+ /// management of it, etc.
+ ///
+ circular_raw_ostream(raw_ostream &Stream, const char *Header,
+ size_t BuffSize = 0, bool Owns = REFERENCE_ONLY)
+ : raw_ostream(/*unbuffered*/ true), OwnsStream(Owns),
+ BufferSize(BuffSize), Banner(Header) {
+ if (BufferSize != 0)
+ BufferArray = new char[BufferSize];
+ Cur = BufferArray;
+ setStream(Stream, Owns);
+ }
+
+ ~circular_raw_ostream() override {
+ flush();
+ flushBufferWithBanner();
+ releaseStream();
+ delete[] BufferArray;
+ }
+
+ bool is_displayed() const override { return TheStream->is_displayed(); }
+
+ /// setStream - Tell the circular_raw_ostream to output a
+ /// different stream. "Owns" tells circular_raw_ostream whether
+ /// it should take responsibility for managing the underlying
+ /// stream.
+ ///
+ void setStream(raw_ostream &Stream, bool Owns = REFERENCE_ONLY) {
+ releaseStream();
+ TheStream = &Stream;
+ OwnsStream = Owns;
+ }
+
+ /// flushBufferWithBanner - Force output of the buffer along with
+ /// a small header.
+ ///
+ void flushBufferWithBanner();
+
+private:
+ /// releaseStream - Delete the held stream if needed. Otherwise,
+ /// transfer the buffer settings from this circular_raw_ostream
+ /// back to the underlying stream.
+ ///
+ void releaseStream() {
+ if (!TheStream)
+ return;
+ if (OwnsStream)
+ delete TheStream;
+ }
+};
} // end llvm namespace
#endif
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index e58732b49d..3107c4bd5e 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -837,7 +837,7 @@ class Error;
/// a temporary file. The final output file is atomically replaced with the
/// temporary file after the \p Write function is finished.
LLVM_ABI Error writeToOutput(StringRef OutputFileName,
- std::function<Error(raw_ostream &)> Write);
+ std::function<Error(raw_ostream &)> Write);
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, std::nullopt_t);
``````````
</details>
https://github.com/llvm/llvm-project/pull/113097
More information about the llvm-commits
mailing list