Skip to content

Commit 6245bc7

Browse files
kazutakahiratackoparkar
authored andcommitted
[CodeGenTypes] Remove redundant declarations (NFC) (llvm#165972)
In C++17, static constexpr members are implicitly inline, so they no longer require an out-of-line definition. This patch also removes redundant "const" from the in-class definitions. Identified with readability-redundant-declaration.
1 parent 181b046 commit 6245bc7

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

llvm/include/llvm/CodeGenTypes/LowLevelType.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,18 @@ class LLT {
340340
/// valid encodings, SizeInBits/SizeOfElement must be larger than 0.
341341
/// * Non-pointer scalar (isPointer == 0 && isVector == 0):
342342
/// SizeInBits: 32;
343-
static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 29};
343+
static constexpr BitFieldInfo ScalarSizeFieldInfo{32, 29};
344344
/// * Pointer (isPointer == 1 && isVector == 0):
345345
/// SizeInBits: 16;
346346
/// AddressSpace: 24;
347-
static const constexpr BitFieldInfo PointerSizeFieldInfo{16, 45};
348-
static const constexpr BitFieldInfo PointerAddressSpaceFieldInfo{24, 21};
347+
static constexpr BitFieldInfo PointerSizeFieldInfo{16, 45};
348+
static constexpr BitFieldInfo PointerAddressSpaceFieldInfo{24, 21};
349349
/// * Vector-of-non-pointer (isPointer == 0 && isVector == 1):
350350
/// NumElements: 16;
351351
/// SizeOfElement: 32;
352352
/// Scalable: 1;
353-
static const constexpr BitFieldInfo VectorElementsFieldInfo{16, 5};
354-
static const constexpr BitFieldInfo VectorScalableFieldInfo{1, 0};
353+
static constexpr BitFieldInfo VectorElementsFieldInfo{16, 5};
354+
static constexpr BitFieldInfo VectorScalableFieldInfo{1, 0};
355355
/// * Vector-of-pointer (isPointer == 1 && isVector == 1):
356356
/// NumElements: 16;
357357
/// SizeOfElement: 16;

llvm/lib/CodeGenTypes/LowLevelType.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,3 @@ LLVM_DUMP_METHOD void LLT::dump() const {
5454
dbgs() << '\n';
5555
}
5656
#endif
57-
58-
const constexpr LLT::BitFieldInfo LLT::ScalarSizeFieldInfo;
59-
const constexpr LLT::BitFieldInfo LLT::PointerSizeFieldInfo;
60-
const constexpr LLT::BitFieldInfo LLT::PointerAddressSpaceFieldInfo;
61-
const constexpr LLT::BitFieldInfo LLT::VectorElementsFieldInfo;
62-
const constexpr LLT::BitFieldInfo LLT::VectorScalableFieldInfo;

0 commit comments

Comments
 (0)