mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[OpenMP][FIX] remove unused variable and long if-else chain
MSVC throws an error if you use "too many" if-else in a row: `Frontend/OpenMP/OMPKinds.def(570): fatal error C1061: compiler limit: blocks nested too deeply` We work around it now...
This commit is contained in:
parent
c61125c80f
commit
702a5efb08
@ -1397,9 +1397,17 @@ void OpenMPInModule::identifyKernels(Module &M) {
|
||||
bool llvm::omp::containsOpenMP(Module &M, OpenMPInModule &OMPInModule) {
|
||||
if (OMPInModule.isKnown())
|
||||
return OMPInModule;
|
||||
|
||||
// MSVC doesn't like long if-else chains for some reason and instead just
|
||||
// issues an error. Work around it..
|
||||
do {
|
||||
#define OMP_RTL(_Enum, _Name, ...) \
|
||||
else if (M.getFunction(_Name)) OMPInModule = true;
|
||||
if (M.getFunction(_Name)) { \
|
||||
OMPInModule = true; \
|
||||
break; \
|
||||
}
|
||||
#include "llvm/Frontend/OpenMP/OMPKinds.def"
|
||||
} while (false);
|
||||
|
||||
// Identify kernels once. TODO: We should split the OMPInformationCache into a
|
||||
// module and an SCC part. The kernel information, among other things, could
|
||||
|
Loading…
Reference in New Issue
Block a user