This patch moves the OpenMPOffloadMappingFlags enum definiition from Clang codegen to OMPConstants.h
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | ||
---|---|---|
193 | I am not sure if this change is safe. It can be avoided by making OpenMPOffloadMappingFlags an enum class. |
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | ||
---|---|---|
193 | Why do you need to change this enum at all? |
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | ||
---|---|---|
193 | Otherwise you'd have two declarations of LLVM_MARK_AS_BITMASK_ENUM in the same namespace which is an error ofc. This is because they are both enums which spill the declarations to the enclosing namespace, I.e. llvm::omp |
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | ||
---|---|---|
193 | But we are using that type in binary operations w/o cast. Does this change then not break existing code? |
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | ||
---|---|---|
193 | Going by the comments LLVM_MARK_AS_BITMASK_ENUM should be used to mark the largest individual enum, don't see any restrictions on it being used with multiple enum's in the same namespace. check-all is also clean. I don't see any evidence of this being unsafe. Changing OpenMPOffloadMappingFlags to enum class however, would be the safest thing to do but that would introduce a lot of ugly static_cast everywhere. |
Changed OpenMPOffloadMappingFlags from enum to enum class. This resolves the conflict with LLVM_MARK_AS_BITMASK_ENUM.
Can you please check why there are so many reformatted lines are part of this patch? Is the clang-format version up to date? Maybe it changed but we should only format the parts touched by the patch, hence git-clang-format HEAD~ rather than format everything.
Missed the other llvm::find_if in previous revision. This should fix Windows build issues.
I am not sure if this change is safe. It can be avoided by making OpenMPOffloadMappingFlags an enum class.