From 92388e8bad5189df01b7982b534afe4f8827e391 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Tue, 12 May 2015 09:15:41 +0300 Subject: [PATCH] ISPC build fix for LLVM trunk revision 237059 --- ispc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ispc.cpp b/ispc.cpp index 170b8658..ad224c39 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -546,8 +546,13 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo // Make sure the target architecture is a known one; print an error // with the valid ones otherwise. +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) && !defined(LLVM_3_6) // 3.7 + + for (llvm::TargetRegistry::iterator iter = llvm::TargetRegistry::targets().begin(); + iter != llvm::TargetRegistry::targets().end(); ++iter) { +#else for (llvm::TargetRegistry::iterator iter = llvm::TargetRegistry::begin(); iter != llvm::TargetRegistry::end(); ++iter) { +#endif if (std::string(arch) == iter->getName()) { this->m_target = &*iter; break; @@ -556,8 +561,13 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo if (this->m_target == NULL) { fprintf(stderr, "Invalid architecture \"%s\"\nOptions: ", arch); llvm::TargetRegistry::iterator iter; +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) && !defined(LLVM_3_6) // 3.7 + + for (iter = llvm::TargetRegistry::targets().begin(); + iter != llvm::TargetRegistry::targets().end(); ++iter) +#else for (iter = llvm::TargetRegistry::begin(); iter != llvm::TargetRegistry::end(); ++iter) +#endif fprintf(stderr, "%s ", iter->getName()); fprintf(stderr, "\n"); error = true;