ISPC build fix for LLVM trunk revision 237059
This commit is contained in:
10
ispc.cpp
10
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
|
// Make sure the target architecture is a known one; print an error
|
||||||
// with the valid ones otherwise.
|
// 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();
|
for (llvm::TargetRegistry::iterator iter = llvm::TargetRegistry::begin();
|
||||||
iter != llvm::TargetRegistry::end(); ++iter) {
|
iter != llvm::TargetRegistry::end(); ++iter) {
|
||||||
|
#endif
|
||||||
if (std::string(arch) == iter->getName()) {
|
if (std::string(arch) == iter->getName()) {
|
||||||
this->m_target = &*iter;
|
this->m_target = &*iter;
|
||||||
break;
|
break;
|
||||||
@@ -556,8 +561,13 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo
|
|||||||
if (this->m_target == NULL) {
|
if (this->m_target == NULL) {
|
||||||
fprintf(stderr, "Invalid architecture \"%s\"\nOptions: ", arch);
|
fprintf(stderr, "Invalid architecture \"%s\"\nOptions: ", arch);
|
||||||
llvm::TargetRegistry::iterator iter;
|
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();
|
for (iter = llvm::TargetRegistry::begin();
|
||||||
iter != llvm::TargetRegistry::end(); ++iter)
|
iter != llvm::TargetRegistry::end(); ++iter)
|
||||||
|
#endif
|
||||||
fprintf(stderr, "%s ", iter->getName());
|
fprintf(stderr, "%s ", iter->getName());
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
error = true;
|
error = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user