[PATCH] D69853: [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h
Jon Chesterfield via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 5 11:52:32 PST 2019
JonChesterfield added inline comments.
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:4011
unsigned NamedModifiersNumber = 0;
- SmallVector<const OMPIfClause *, OMPC_unknown + 1> FoundNameModifiers(
- OMPD_unknown + 1);
+ SmallVector<const OMPIfClause *, unsigned(OMPC_unknown) + 1>
+ FoundNameModifiers(unsigned(OMPD_unknown) + 1);
----------------
I wonder if it would be worth wrapping the accesses to FoundNameModifiers in functor that does the enum class to unsigned conversion. E.g. a class instance that contains the small vector and exposes operator[] that takes the enum class.
FoundNameModifiers[unsigned(val)] is quite a lot of line noise.
================
Comment at: llvm/lib/IR/OpenMPIRBuilder.cpp:11
+
+#include "llvm/IR/OpenMPConstants.h"
+
----------------
Implemented in OpenMPConstants.cpp instead? Functions look usable independent of MPIRBuilder.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69853/new/
https://reviews.llvm.org/D69853
More information about the cfe-commits
mailing list