diff --git a/bolt/include/bolt/Core/BinaryBasicBlock.h b/bolt/include/bolt/Core/BinaryBasicBlock.h index d24c653c157d..3e0f81592bc1 100644 --- a/bolt/include/bolt/Core/BinaryBasicBlock.h +++ b/bolt/include/bolt/Core/BinaryBasicBlock.h @@ -985,7 +985,7 @@ private: #if defined(LLVM_ON_UNIX) /// Keep the size of the BinaryBasicBlock within a reasonable size class /// (jemalloc bucket) on Linux -static_assert(sizeof(BinaryBasicBlock) <= 256, ""); +static_assert(sizeof(BinaryBasicBlock) <= 256); #endif bool operator<(const BinaryBasicBlock &LHS, const BinaryBasicBlock &RHS); diff --git a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp index 99853985d931..4841da567350 100644 --- a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp @@ -90,7 +90,7 @@ struct AllHeuristicsBoundsWellConfigured { 1>::Value; }; -static_assert(AllHeuristicsBoundsWellConfigured::Value, ""); +static_assert(AllHeuristicsBoundsWellConfigured::Value); } // namespace static constexpr llvm::StringLiteral DefaultAbbreviations = "addr=address;" diff --git a/clang-tools-extra/clangd/Quality.cpp b/clang-tools-extra/clangd/Quality.cpp index 6fa9861b1dab..182848525a45 100644 --- a/clang-tools-extra/clangd/Quality.cpp +++ b/clang-tools-extra/clangd/Quality.cpp @@ -591,7 +591,7 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality, // Produces an integer that sorts in the same order as F. // That is: a < b <==> encodeFloat(a) < encodeFloat(b). static uint32_t encodeFloat(float F) { - static_assert(std::numeric_limits::is_iec559, ""); + static_assert(std::numeric_limits::is_iec559); constexpr uint32_t TopBit = ~(~uint32_t{0} >> 1); // Get the bits of the float. Endianness is the same as for integers. diff --git a/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h b/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h index e36e763937d6..769bd2350829 100644 --- a/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h +++ b/clang-tools-extra/pseudo/include/clang-pseudo/Forest.h @@ -157,7 +157,7 @@ private: // An array of ForestNode* following the object. }; // ForestNode may not be destroyed (for BumpPtrAllocator). -static_assert(std::is_trivially_destructible(), ""); +static_assert(std::is_trivially_destructible()); // A memory arena for the parse forest. class ForestArena { diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp index 9373e0b24fe0..e51dde5e3f08 100644 --- a/lld/MachO/SyntheticSections.cpp +++ b/lld/MachO/SyntheticSections.cpp @@ -58,7 +58,7 @@ static void sha256(const uint8_t *data, size_t len, uint8_t *output) { #else ArrayRef block(data, len); std::array hash = SHA256::hash(block); - static_assert(hash.size() == CodeSignatureSection::hashSize, ""); + static_assert(hash.size() == CodeSignatureSection::hashSize); memcpy(output, hash.data(), hash.size()); #endif } @@ -1381,8 +1381,8 @@ void StringTableSection::writeTo(uint8_t *buf) const { } } -static_assert((CodeSignatureSection::blobHeadersSize % 8) == 0, ""); -static_assert((CodeSignatureSection::fixedHeadersSize % 8) == 0, ""); +static_assert((CodeSignatureSection::blobHeadersSize % 8) == 0); +static_assert((CodeSignatureSection::fixedHeadersSize % 8) == 0); CodeSignatureSection::CodeSignatureSection() : LinkEditSection(segment_names::linkEdit, section_names::codeSignature) { diff --git a/lld/MachO/SyntheticSections.h b/lld/MachO/SyntheticSections.h index ac9bde62e669..176e842bc2af 100644 --- a/lld/MachO/SyntheticSections.h +++ b/lld/MachO/SyntheticSections.h @@ -581,7 +581,7 @@ public: using UInt128 = std::pair; // I don't think the standard guarantees the size of a pair, so let's make // sure it's exact -- that way we can construct it via `mmap`. - static_assert(sizeof(UInt128) == 16, ""); + static_assert(sizeof(UInt128) == 16); WordLiteralSection(); void addInput(WordLiteralInputSection *); diff --git a/lld/MachO/UnwindInfoSection.cpp b/lld/MachO/UnwindInfoSection.cpp index c78fef33fd3d..f46c532dd04f 100644 --- a/lld/MachO/UnwindInfoSection.cpp +++ b/lld/MachO/UnwindInfoSection.cpp @@ -394,11 +394,9 @@ static bool canFoldEncoding(compact_unwind_encoding_t encoding) { // unwind info can't be folded if it's using this encoding since both // entries need unique addresses. static_assert(static_cast(UNWIND_X86_64_MODE_MASK) == - static_cast(UNWIND_X86_MODE_MASK), - ""); + static_cast(UNWIND_X86_MODE_MASK)); static_assert(static_cast(UNWIND_X86_64_MODE_STACK_IND) == - static_cast(UNWIND_X86_MODE_STACK_IND), - ""); + static_cast(UNWIND_X86_MODE_STACK_IND)); if ((target->cpuType == CPU_TYPE_X86_64 || target->cpuType == CPU_TYPE_X86) && (encoding & UNWIND_X86_64_MODE_MASK) == UNWIND_X86_64_MODE_STACK_IND) { // FIXME: Consider passing in the two function addresses and getting diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h index cdedb6ece992..dffb259b33c7 100644 --- a/llvm/include/llvm/ADT/APFloat.h +++ b/llvm/include/llvm/ADT/APFloat.h @@ -702,7 +702,7 @@ class APFloat : public APFloatBase { typedef detail::IEEEFloat IEEEFloat; typedef detail::DoubleAPFloat DoubleAPFloat; - static_assert(std::is_standard_layout::value, ""); + static_assert(std::is_standard_layout::value); union Storage { const fltSemantics *semantics; @@ -795,7 +795,7 @@ class APFloat : public APFloatBase { template static bool usesLayout(const fltSemantics &Semantics) { static_assert(std::is_same::value || - std::is_same::value, ""); + std::is_same::value); if (std::is_same::value) { return &Semantics == &PPCDoubleDouble(); } diff --git a/llvm/include/llvm/Analysis/CmpInstAnalysis.h b/llvm/include/llvm/Analysis/CmpInstAnalysis.h index 332eb9b66e9c..1d07a0c22887 100644 --- a/llvm/include/llvm/Analysis/CmpInstAnalysis.h +++ b/llvm/include/llvm/Analysis/CmpInstAnalysis.h @@ -64,23 +64,23 @@ namespace llvm { assert(CmpInst::FCMP_FALSE <= CC && CC <= CmpInst::FCMP_TRUE && "Unexpected FCmp predicate!"); // Take advantage of the bit pattern of CmpInst::Predicate here. - // U L G E - static_assert(CmpInst::FCMP_FALSE == 0, ""); // 0 0 0 0 - static_assert(CmpInst::FCMP_OEQ == 1, ""); // 0 0 0 1 - static_assert(CmpInst::FCMP_OGT == 2, ""); // 0 0 1 0 - static_assert(CmpInst::FCMP_OGE == 3, ""); // 0 0 1 1 - static_assert(CmpInst::FCMP_OLT == 4, ""); // 0 1 0 0 - static_assert(CmpInst::FCMP_OLE == 5, ""); // 0 1 0 1 - static_assert(CmpInst::FCMP_ONE == 6, ""); // 0 1 1 0 - static_assert(CmpInst::FCMP_ORD == 7, ""); // 0 1 1 1 - static_assert(CmpInst::FCMP_UNO == 8, ""); // 1 0 0 0 - static_assert(CmpInst::FCMP_UEQ == 9, ""); // 1 0 0 1 - static_assert(CmpInst::FCMP_UGT == 10, ""); // 1 0 1 0 - static_assert(CmpInst::FCMP_UGE == 11, ""); // 1 0 1 1 - static_assert(CmpInst::FCMP_ULT == 12, ""); // 1 1 0 0 - static_assert(CmpInst::FCMP_ULE == 13, ""); // 1 1 0 1 - static_assert(CmpInst::FCMP_UNE == 14, ""); // 1 1 1 0 - static_assert(CmpInst::FCMP_TRUE == 15, ""); // 1 1 1 1 + // U L G E + static_assert(CmpInst::FCMP_FALSE == 0); // 0 0 0 0 + static_assert(CmpInst::FCMP_OEQ == 1); // 0 0 0 1 + static_assert(CmpInst::FCMP_OGT == 2); // 0 0 1 0 + static_assert(CmpInst::FCMP_OGE == 3); // 0 0 1 1 + static_assert(CmpInst::FCMP_OLT == 4); // 0 1 0 0 + static_assert(CmpInst::FCMP_OLE == 5); // 0 1 0 1 + static_assert(CmpInst::FCMP_ONE == 6); // 0 1 1 0 + static_assert(CmpInst::FCMP_ORD == 7); // 0 1 1 1 + static_assert(CmpInst::FCMP_UNO == 8); // 1 0 0 0 + static_assert(CmpInst::FCMP_UEQ == 9); // 1 0 0 1 + static_assert(CmpInst::FCMP_UGT == 10); // 1 0 1 0 + static_assert(CmpInst::FCMP_UGE == 11); // 1 0 1 1 + static_assert(CmpInst::FCMP_ULT == 12); // 1 1 0 0 + static_assert(CmpInst::FCMP_ULE == 13); // 1 1 0 1 + static_assert(CmpInst::FCMP_UNE == 14); // 1 1 1 0 + static_assert(CmpInst::FCMP_TRUE == 15); // 1 1 1 1 return CC; } diff --git a/llvm/include/llvm/BinaryFormat/MachO.h b/llvm/include/llvm/BinaryFormat/MachO.h index 04be767250e6..4616daf30d44 100644 --- a/llvm/include/llvm/BinaryFormat/MachO.h +++ b/llvm/include/llvm/BinaryFormat/MachO.h @@ -2342,7 +2342,7 @@ struct CS_CodeDirectory { uint64_t execSegFlags; /* executable segment flags */ }; -static_assert(sizeof(CS_CodeDirectory) == 88, ""); +static_assert(sizeof(CS_CodeDirectory) == 88); struct CS_BlobIndex { uint32_t type; /* type of entry */ diff --git a/llvm/include/llvm/BinaryFormat/Minidump.h b/llvm/include/llvm/BinaryFormat/Minidump.h index 89cd779951cf..bc303929498d 100644 --- a/llvm/include/llvm/BinaryFormat/Minidump.h +++ b/llvm/include/llvm/BinaryFormat/Minidump.h @@ -43,7 +43,7 @@ struct Header { support::ulittle32_t TimeDateStamp; support::ulittle64_t Flags; }; -static_assert(sizeof(Header) == 32, ""); +static_assert(sizeof(Header) == 32); /// The type of a minidump stream identifies its contents. Streams numbers after /// LastReserved are for application-defined data streams. @@ -60,7 +60,7 @@ struct LocationDescriptor { support::ulittle32_t DataSize; support::ulittle32_t RVA; }; -static_assert(sizeof(LocationDescriptor) == 8, ""); +static_assert(sizeof(LocationDescriptor) == 8); /// Describes a single memory range (both its VM address and where to find it in /// the file) of the process from which this minidump file was generated. @@ -68,7 +68,7 @@ struct MemoryDescriptor { support::ulittle64_t StartOfMemoryRange; LocationDescriptor Memory; }; -static_assert(sizeof(MemoryDescriptor) == 16, ""); +static_assert(sizeof(MemoryDescriptor) == 16); struct MemoryInfoListHeader { support::ulittle32_t SizeOfHeader; @@ -81,7 +81,7 @@ struct MemoryInfoListHeader { : SizeOfHeader(SizeOfHeader), SizeOfEntry(SizeOfEntry), NumberOfEntries(NumberOfEntries) {} }; -static_assert(sizeof(MemoryInfoListHeader) == 16, ""); +static_assert(sizeof(MemoryInfoListHeader) == 16); enum class MemoryProtection : uint32_t { #define HANDLE_MDMP_PROTECT(CODE, NAME, NATIVENAME) NAME = CODE, @@ -112,7 +112,7 @@ struct MemoryInfo { support::little_t Type; support::ulittle32_t Reserved1; }; -static_assert(sizeof(MemoryInfo) == 48, ""); +static_assert(sizeof(MemoryInfo) == 48); /// Specifies the location and type of a single stream in the minidump file. The /// minidump stream directory is an array of entries of this type, with its size @@ -121,7 +121,7 @@ struct Directory { support::little_t Type; LocationDescriptor Location; }; -static_assert(sizeof(Directory) == 12, ""); +static_assert(sizeof(Directory) == 12); /// The processor architecture of the system that generated this minidump. Used /// in the ProcessorArch field of the SystemInfo stream. @@ -154,7 +154,7 @@ union CPUInfo { uint8_t ProcessorFeatures[16]; } Other; }; -static_assert(sizeof(CPUInfo) == 24, ""); +static_assert(sizeof(CPUInfo) == 24); /// The SystemInfo stream, containing various information about the system where /// this minidump was generated. @@ -177,7 +177,7 @@ struct SystemInfo { CPUInfo CPU; }; -static_assert(sizeof(SystemInfo) == 56, ""); +static_assert(sizeof(SystemInfo) == 56); struct VSFixedFileInfo { support::ulittle32_t Signature; @@ -194,7 +194,7 @@ struct VSFixedFileInfo { support::ulittle32_t FileDateHigh; support::ulittle32_t FileDateLow; }; -static_assert(sizeof(VSFixedFileInfo) == 52, ""); +static_assert(sizeof(VSFixedFileInfo) == 52); inline bool operator==(const VSFixedFileInfo &LHS, const VSFixedFileInfo &RHS) { return memcmp(&LHS, &RHS, sizeof(VSFixedFileInfo)) == 0; @@ -212,7 +212,7 @@ struct Module { support::ulittle64_t Reserved0; support::ulittle64_t Reserved1; }; -static_assert(sizeof(Module) == 108, ""); +static_assert(sizeof(Module) == 108); /// Describes a single thread in the minidump file. Part of the ThreadList /// stream. @@ -225,7 +225,7 @@ struct Thread { MemoryDescriptor Stack; LocationDescriptor Context; }; -static_assert(sizeof(Thread) == 48, ""); +static_assert(sizeof(Thread) == 48); struct Exception { static constexpr size_t MaxParameters = 15; @@ -238,7 +238,7 @@ struct Exception { support::ulittle32_t UnusedAlignment; support::ulittle64_t ExceptionInformation[MaxParameters]; }; -static_assert(sizeof(Exception) == 152, ""); +static_assert(sizeof(Exception) == 152); struct ExceptionStream { support::ulittle32_t ThreadId; @@ -246,7 +246,7 @@ struct ExceptionStream { Exception ExceptionRecord; LocationDescriptor ThreadContext; }; -static_assert(sizeof(ExceptionStream) == 168, ""); +static_assert(sizeof(ExceptionStream) == 168); } // namespace minidump diff --git a/llvm/include/llvm/CodeGen/AccelTable.h b/llvm/include/llvm/CodeGen/AccelTable.h index c0e976317aef..be7ed03deb27 100644 --- a/llvm/include/llvm/CodeGen/AccelTable.h +++ b/llvm/include/llvm/CodeGen/AccelTable.h @@ -300,7 +300,7 @@ void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents, template void emitAppleAccelTable(AsmPrinter *Asm, AccelTable &Contents, StringRef Prefix, const MCSymbol *SecBegin) { - static_assert(std::is_convertible::value, ""); + static_assert(std::is_convertible::value); emitAppleAccelTableImpl(Asm, Contents, Prefix, SecBegin, DataT::Atoms); } diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangle.h b/llvm/include/llvm/Demangle/MicrosoftDemangle.h index 6f2d0416901e..f1a5e1b64ebb 100644 --- a/llvm/include/llvm/Demangle/MicrosoftDemangle.h +++ b/llvm/include/llvm/Demangle/MicrosoftDemangle.h @@ -100,7 +100,7 @@ public: if (Head->Used <= Head->Capacity) return new (PP) T(std::forward(ConstructorArgs)...); - static_assert(Size < AllocUnit, ""); + static_assert(Size < AllocUnit); addNode(AllocUnit); Head->Used = Size; return new (Head->Buf) T(std::forward(ConstructorArgs)...); diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h b/llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h index 89f5de229b3b..cd9f02484be2 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h +++ b/llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h @@ -100,7 +100,7 @@ static constexpr GV AMDGPUGridValues32 = { }; template constexpr const GV &getAMDGPUGridValues() { - static_assert(wavesize == 32 || wavesize == 64, ""); + static_assert(wavesize == 32 || wavesize == 64); return wavesize == 32 ? AMDGPUGridValues32 : AMDGPUGridValues64; } diff --git a/llvm/include/llvm/Testing/Support/Error.h b/llvm/include/llvm/Testing/Support/Error.h index c04e4e2abf0c..c1ca92f5e4a2 100644 --- a/llvm/include/llvm/Testing/Support/Error.h +++ b/llvm/include/llvm/Testing/Support/Error.h @@ -207,7 +207,7 @@ testing::Matcher Failed(M Matcher) { template testing::Matcher FailedWithMessage(M... Matcher) { - static_assert(sizeof...(M) > 0, ""); + static_assert(sizeof...(M) > 0); return MakeMatcher( new detail::ErrorMessageMatches(testing::ElementsAre(Matcher...))); } diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h index 16f0082723ed..6f0968ead667 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h @@ -82,7 +82,7 @@ public: } }; - static_assert(sizeof(uint64_t) == sizeof(LocalVarDef), ""); + static_assert(sizeof(uint64_t) == sizeof(LocalVarDef)); private: MCStreamer &OS; diff --git a/llvm/lib/Support/SHA1.cpp b/llvm/lib/Support/SHA1.cpp index 52bae700350d..df3658c076a8 100644 --- a/llvm/lib/Support/SHA1.cpp +++ b/llvm/lib/Support/SHA1.cpp @@ -225,7 +225,7 @@ void SHA1::update(ArrayRef Data) { // Fast buffer filling for large inputs. while (Data.size() >= BLOCK_LENGTH) { assert(InternalState.BufferOffset == 0); - static_assert(BLOCK_LENGTH % 4 == 0, ""); + static_assert(BLOCK_LENGTH % 4 == 0); constexpr size_t BLOCK_LENGTH_32 = BLOCK_LENGTH / 4; for (size_t I = 0; I < BLOCK_LENGTH_32; ++I) InternalState.Buffer.L[I] = support::endian::read32be(&Data[I * 4]); @@ -288,7 +288,7 @@ std::array SHA1::final() { std::array HashResult; std::array ReturnResult; }; - static_assert(sizeof(HashResult) == sizeof(ReturnResult), ""); + static_assert(sizeof(HashResult) == sizeof(ReturnResult)); final(HashResult); return ReturnResult; } diff --git a/llvm/lib/Support/SHA256.cpp b/llvm/lib/Support/SHA256.cpp index 81d897fb4187..46cbb67e86bc 100644 --- a/llvm/lib/Support/SHA256.cpp +++ b/llvm/lib/Support/SHA256.cpp @@ -204,7 +204,7 @@ void SHA256::update(ArrayRef Data) { // Fast buffer filling for large inputs. while (Data.size() >= BLOCK_LENGTH) { assert(InternalState.BufferOffset == 0); - static_assert(BLOCK_LENGTH % 4 == 0, ""); + static_assert(BLOCK_LENGTH % 4 == 0); constexpr size_t BLOCK_LENGTH_32 = BLOCK_LENGTH / 4; for (size_t I = 0; I < BLOCK_LENGTH_32; ++I) InternalState.Buffer.L[I] = support::endian::read32be(&Data[I * 4]); @@ -268,7 +268,7 @@ std::array SHA256::final() { std::array HashResult; std::array ReturnResult; }; - static_assert(sizeof(HashResult) == sizeof(ReturnResult), ""); + static_assert(sizeof(HashResult) == sizeof(ReturnResult)); final(HashResult); return ReturnResult; } diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp index 3af5d92bb546..97a16219bacc 100644 --- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp +++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp @@ -1513,7 +1513,7 @@ MCOperand AMDGPUDisassembler::decodeSrcOp(const OpWidthTy Width, unsigned Val, } if (Val <= SGPR_MAX) { // "SGPR_MIN <= Val" is always true and causes compilation warning. - static_assert(SGPR_MIN == 0, ""); + static_assert(SGPR_MIN == 0); return createSRegOperand(getSgprClassId(Width), Val - SGPR_MIN); } @@ -1557,7 +1557,7 @@ MCOperand AMDGPUDisassembler::decodeDstOp(const OpWidthTy Width, unsigned Val) c if (Val <= SGPR_MAX) { // "SGPR_MIN <= Val" is always true and causes compilation warning. - static_assert(SGPR_MIN == 0, ""); + static_assert(SGPR_MIN == 0); return createSRegOperand(getSgprClassId(Width), Val - SGPR_MIN); } diff --git a/llvm/utils/TableGen/X86DisassemblerTables.cpp b/llvm/utils/TableGen/X86DisassemblerTables.cpp index 2fa8fce81422..1f3ab4863b85 100644 --- a/llvm/utils/TableGen/X86DisassemblerTables.cpp +++ b/llvm/utils/TableGen/X86DisassemblerTables.cpp @@ -763,7 +763,7 @@ void DisassemblerTables::emitOpcodeDecision(raw_ostream &o1, raw_ostream &o2, } if (index == 256) { // If all 256 entries are MODRM_ONEENTRY, omit output. - static_assert(MODRM_ONEENTRY == 0, ""); + static_assert(MODRM_ONEENTRY == 0); --i2; o2 << "},\n"; } else {