diff -ru ispc-1.11.0.orig/CMakeLists.txt ispc-1.11.0/CMakeLists.txt --- ispc-1.11.0.orig/CMakeLists.txt 2019-04-19 16:28:43.000000000 -0700 +++ ispc-1.11.0/CMakeLists.txt 2019-04-22 00:10:26.698430396 -0700 @@ -236,7 +236,7 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) if (UNIX) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) - target_compile_options(${PROJECT_NAME} PRIVATE -Wno-c99-extensions -Wno-deprecated-register -fno-rtti) + target_compile_options(${PROJECT_NAME} PRIVATE -fno-rtti) if (ISPC_USE_ASAN) target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address) endif() diff -ru ispc-1.11.0.orig/Makefile ispc-1.11.0/Makefile --- ispc-1.11.0.orig/Makefile 2019-04-19 16:28:43.000000000 -0700 +++ ispc-1.11.0/Makefile 2019-04-21 23:59:38.189050091 -0700 @@ -175,11 +175,11 @@ $(LLVM_VERSION_DEF) \ -Wall \ -DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_VERSION="\"$(BUILD_VERSION)\"" \ - -Wno-sign-compare -Wno-unused-function $(WERROR) + -Wno-sign-compare -Wno-unused-function # if( !($(LLVM_VERSION) == LLVM_3_2 || $(LLVM_VERSION) == LLVM_3_3 || $(LLVM_VERSION) == LLVM_3_4)) ifeq (,$(filter $(LLVM_VERSION), LLVM_3_2 LLVM_3_3 LLVM_3_4)) - CXXFLAGS+=-std=c++11 -Wno-c99-extensions -Wno-deprecated-register -fno-rtti + CXXFLAGS+=-std=c++11 -fno-rtti endif ifneq ($(ARM_ENABLED), 0) CXXFLAGS+=-DISPC_ARM_ENABLED @@ -240,7 +240,7 @@ depend: llvm_check $(CXX_SRC) $(HEADERS) @echo Updating dependencies - @$(CXX) -MM $(CXXFLAGS) $(CXX_SRC) | sed 's_^\([a-z]\)_objs/\1_g' > depend + $(CXX) -MM $(CXXFLAGS) $(CXX_SRC) | sed 's_^\([a-z]\)_objs/\1_g' > depend -include depend @@ -273,7 +273,7 @@ ispc: print_deprecation_msg print_llvm_src dirs $(OBJS) @echo Creating ispc executable - @$(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS) + $(CXX) $(OPT) $(LDFLAGS) -o $@ $(OBJS) $(ISPC_LIBS) # Use clang as a default compiler, instead of gcc # This is default now. @@ -295,77 +295,77 @@ objs/%.o: ${SRC_DIR}/%.cpp @echo Compiling $< - @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(CXX) $(CXXFLAGS) -o $@ -c $< objs/cbackend.o: ${SRC_DIR}/cbackend.cpp @echo Compiling $< - @$(CXX) -fno-rtti -fno-exceptions $(CXXFLAGS) -o $@ -c $< + $(CXX) -fno-rtti -fno-exceptions $(CXXFLAGS) -o $@ -c $< objs/opt.o: ${SRC_DIR}/opt.cpp @echo Compiling $< - @$(CXX) -fno-rtti $(CXXFLAGS) -o $@ -c $< + $(CXX) -fno-rtti $(CXXFLAGS) -o $@ -c $< objs/%.o: objs/%.cpp @echo Compiling $< - @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(CXX) $(CXXFLAGS) -o $@ -c $< objs/parse.cc: $(SRC_DIR)/parse.yy @echo Running bison on $< - @$(YACC) -o $@ $< + $(YACC) -o $@ $< objs/parse.o: objs/parse.cc $(HEADERS) @echo Compiling $< - @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(CXX) $(CXXFLAGS) -o $@ -c $< objs/lex.cpp: $(SRC_DIR)/lex.ll @echo Running flex on $< - @$(LEX) -o $@ $< + $(LEX) -o $@ $< objs/lex.o: objs/lex.cpp $(HEADERS) objs/parse.cc @echo Compiling $< - @$(CXX) $(CXXFLAGS) -o $@ -c $< + $(CXX) $(CXXFLAGS) -o $@ -c $< objs/builtins-dispatch.cpp: builtins/dispatch.ll builtins/util.m4 builtins/util-nvptx.m4 builtins/svml.m4 $(wildcard builtins/*common.ll) @echo Creating C++ source from builtins definition file $< - @m4 -Ibuiltins/ -DLLVM_VERSION=$(LLVM_VERSION) -DBUILD_OS=UNIX $< | python bitcode2cpp.py $< > $@ + m4 -Ibuiltins/ -DLLVM_VERSION=$(LLVM_VERSION) -DBUILD_OS=UNIX $< | python bitcode2cpp.py $< > $@ objs/builtins-%-32bit.cpp: builtins/%.ll builtins/util.m4 builtins/util-nvptx.m4 builtins/svml.m4 $(wildcard builtins/*common.ll) @echo Creating C++ source from builtins definition file $< \(32 bit version\) - @m4 -Ibuiltins/ -DLLVM_VERSION=$(LLVM_VERSION) -DBUILD_OS=UNIX -DRUNTIME=32 $< | python bitcode2cpp.py $< 32bit > $@ + m4 -Ibuiltins/ -DLLVM_VERSION=$(LLVM_VERSION) -DBUILD_OS=UNIX -DRUNTIME=32 $< | python bitcode2cpp.py $< 32bit > $@ objs/builtins-%-64bit.cpp: builtins/%.ll builtins/util.m4 builtins/util-nvptx.m4 builtins/svml.m4 $(wildcard builtins/*common.ll) @echo Creating C++ source from builtins definition file $< \(64 bit version\) - @m4 -Ibuiltins/ -DLLVM_VERSION=$(LLVM_VERSION) -DBUILD_OS=UNIX -DRUNTIME=64 $< | python bitcode2cpp.py $< 64bit > $@ + m4 -Ibuiltins/ -DLLVM_VERSION=$(LLVM_VERSION) -DBUILD_OS=UNIX -DRUNTIME=64 $< | python bitcode2cpp.py $< 64bit > $@ objs/builtins-c-32.cpp: builtins/builtins.c @echo Creating C++ source from builtins definition file $< - @$(CLANG) -m32 -emit-llvm -c $< -o - | llvm-dis - | python bitcode2cpp.py c 32 > $@ + $(CLANG) -m32 -emit-llvm -c $< -o - | llvm-dis - | python bitcode2cpp.py c 32 > $@ objs/builtins-c-64.cpp: builtins/builtins.c @echo Creating C++ source from builtins definition file $< - @$(CLANG) -m64 -emit-llvm -c $< -o - | llvm-dis - | python bitcode2cpp.py c 64 > $@ + $(CLANG) -m64 -emit-llvm -c $< -o - | llvm-dis - | python bitcode2cpp.py c 64 > $@ objs/stdlib_mask1_ispc.cpp: stdlib.ispc @echo Creating C++ source from $< for mask1 - @$(CLANG) -E -x c -DISPC_MASK_BITS=1 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ + $(CLANG) -E -x c -DISPC_MASK_BITS=1 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ python stdlib2cpp.py mask1 > $@ objs/stdlib_mask8_ispc.cpp: stdlib.ispc @echo Creating C++ source from $< for mask8 - @$(CLANG) -E -x c -DISPC_MASK_BITS=8 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ + $(CLANG) -E -x c -DISPC_MASK_BITS=8 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ python stdlib2cpp.py mask8 > $@ objs/stdlib_mask16_ispc.cpp: stdlib.ispc @echo Creating C++ source from $< for mask16 - @$(CLANG) -E -x c -DISPC_MASK_BITS=16 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ + $(CLANG) -E -x c -DISPC_MASK_BITS=16 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ python stdlib2cpp.py mask16 > $@ objs/stdlib_mask32_ispc.cpp: stdlib.ispc @echo Creating C++ source from $< for mask32 - @$(CLANG) -E -x c -DISPC_MASK_BITS=32 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ + $(CLANG) -E -x c -DISPC_MASK_BITS=32 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ python stdlib2cpp.py mask32 > $@ objs/stdlib_mask64_ispc.cpp: stdlib.ispc @echo Creating C++ source from $< for mask64 - @$(CLANG) -E -x c -DISPC_MASK_BITS=64 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ + $(CLANG) -E -x c -DISPC_MASK_BITS=64 -DISPC=1 -DPI=3.14159265358979 $< -o - | \ python stdlib2cpp.py mask64 > $@ diff -ru ispc-1.11.0.orig/src/llvmutil.cpp ispc-1.11.0/src/llvmutil.cpp --- ispc-1.11.0.orig/src/llvmutil.cpp 2019-04-19 16:28:43.000000000 -0700 +++ ispc-1.11.0/src/llvmutil.cpp 2019-04-20 16:04:44.137970246 -0700 @@ -1041,11 +1041,11 @@ #if 0 fprintf(stderr, "all equal: "); - v->dump(); + v->print(llvm::errs()); fprintf(stderr, "\n"); llvm::Instruction *inst = llvm::dyn_cast(v); if (inst) { - inst->getParent()->dump(); + inst->getParent()->print(llvm::errs()); fprintf(stderr, "\n"); fprintf(stderr, "\n"); } @@ -1305,11 +1305,11 @@ #if 0 fprintf(stderr, "linear check: "); - v->dump(); + v->print(llvm::errs()); fprintf(stderr, "\n"); llvm::Instruction *inst = llvm::dyn_cast(v); if (inst) { - inst->getParent()->dump(); + inst->getParent()->print(llvm::errs()); fprintf(stderr, "\n"); fprintf(stderr, "\n"); } @@ -1349,7 +1349,7 @@ return; fprintf(stderr, " "); - v->dump(); + v->print(llvm::errs()); done.insert(v); if (inst == NULL) diff -ru ispc-1.11.0.orig/src/opt.cpp ispc-1.11.0/src/opt.cpp --- ispc-1.11.0.orig/src/opt.cpp 2019-04-19 16:28:43.000000000 -0700 +++ ispc-1.11.0/src/opt.cpp 2019-04-20 16:09:04.572689746 -0700 @@ -175,7 +175,7 @@ getenv("FUNC"), strlen(getenv("FUNC")))))) { \ fprintf(stderr, "Start of " NAME "\n"); \ fprintf(stderr, "---------------\n"); \ - bb.dump(); \ + bb.print(llvm::errs()); \ fprintf(stderr, "---------------\n\n"); \ } else /* eat semicolon */ @@ -185,7 +185,7 @@ getenv("FUNC"), strlen(getenv("FUNC")))))) { \ fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \ fprintf(stderr, "---------------\n"); \ - bb.dump(); \ + bb.print(llvm::errs()); \ fprintf(stderr, "---------------\n\n"); \ } else /* eat semicolon */ #else @@ -406,7 +406,7 @@ llvm::TargetMachine *targetMachine = g->target->GetTargetMachine(); const llvm::TargetData *td = targetMachine->getTargetData(); llvm::Constant *c = llvm::ConstantFoldConstantExpression(ce, td); - c->dump(); + c->print(llvm::errs()); factor = c; } // else we should be able to handle it above... @@ -505,7 +505,7 @@ #ifndef ISPC_NO_DUMPS if (g->debugPrint) { printf("*** Code going into optimization ***\n"); - module->dump(); + module->print(llvm::errs(), nullptr); } #endif DebugPassManager optPM; @@ -892,7 +892,7 @@ #ifndef ISPC_NO_DUMPS if (g->debugPrint) { printf("\n*****\nFINAL OUTPUT\n*****\n"); - module->dump(); + module->print(llvm::errs(), nullptr); } #endif } @@ -1859,7 +1859,7 @@ static llvm::Value * lExtractUniforms(llvm::Value **vec, llvm::Instruction *insertBefore) { fprintf(stderr, " lextract: "); - (*vec)->dump(); + (*vec)->print(llvm::errs()); fprintf(stderr, "\n"); if (llvm::isa(*vec) || @@ -1944,11 +1944,11 @@ llvm::Value *offsetScale, llvm::Instruction *insertBefore) { #if 1 - (*basePtr)->dump(); + (*basePtr)->print(llvm::errs()); printf("\n"); - (*offsetVector)->dump(); + (*offsetVector)->print(llvm::errs()); printf("\n"); - offsetScale->dump(); + offsetScale->print(llvm::errs()); printf("-----\n"); #endif @@ -4394,7 +4394,7 @@ bool DebugPass::runOnModule(llvm::Module &module) { fprintf(stderr, "%s", str_output); fflush(stderr); - module.dump(); + module.print(llvm::errs(), nullptr); return true; }