Skip to content

Commit 21ce61b

Browse files
[ADT] Use "static inline" to initialize EmptyDivergenceDesc; (NFC) (#160445)
In C++17, we can initialize a static member variable with "static inline" as part of the class definition. With this, we can eliminate the out-of-line static initializer involving boilerplate template code.
1 parent 3b5c6bf commit 21ce61b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/include/llvm/ADT/GenericUniformityImpl.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ template <typename ContextT> class GenericSyncDependenceAnalysis {
310310
const DivergenceDescriptor &getJoinBlocks(const BlockT *DivTermBlock);
311311

312312
private:
313-
static DivergenceDescriptor EmptyDivergenceDesc;
313+
static inline DivergenceDescriptor EmptyDivergenceDesc;
314314

315315
ModifiedPO CyclePO;
316316

@@ -741,10 +741,6 @@ template <typename ContextT> class DivergencePropagator {
741741
}
742742
};
743743

744-
template <typename ContextT>
745-
typename llvm::GenericSyncDependenceAnalysis<ContextT>::DivergenceDescriptor
746-
llvm::GenericSyncDependenceAnalysis<ContextT>::EmptyDivergenceDesc;
747-
748744
template <typename ContextT>
749745
llvm::GenericSyncDependenceAnalysis<ContextT>::GenericSyncDependenceAnalysis(
750746
const ContextT &Context, const DominatorTreeT &DT, const CycleInfoT &CI)

0 commit comments

Comments
 (0)