[llvm-commits] CVS: llvm/lib/Target/Sparc/Makefile

Misha Brukman brukman at cs.uiuc.edu
Thu May 29 00:30:03 PDT 2003


Changes in directory llvm/lib/Target/Sparc:

Makefile updated: 1.17 -> 1.18

---
Log message:

When TableGen finds an error in the SparcV9.td file, it exits with a non-zero
exit code. This, in turn, makes an empty file SparcV9CodeEmitter.inc, and only
much later, produces a link error because the key function that TableGen creates
isn't found.

Using a temporary file in the middle forces a good .INC file to be generated by
TableGen, and it will keep trying until you fix the input file.


---
Diffs of the changes:

Index: llvm/lib/Target/Sparc/Makefile
diff -u llvm/lib/Target/Sparc/Makefile:1.17 llvm/lib/Target/Sparc/Makefile:1.18
--- llvm/lib/Target/Sparc/Makefile:1.17	Wed May 28 22:32:49 2003
+++ llvm/lib/Target/Sparc/Makefile	Thu May 29 00:29:22 2003
@@ -34,9 +34,12 @@
 
 SparcV9CodeEmitter.cpp: SparcV9CodeEmitter.inc
 
+TEMP_EMITTER_INC = _temp_emitter.inc
+
 SparcV9CodeEmitter.inc: SparcV9.td
 	@echo "TableGen-erating $@"
-	cpp -P SparcV9.td | tblgen -gen-emitter > SparcV9CodeEmitter.inc
+	cpp -P SparcV9.td | tblgen -gen-emitter > $(TEMP_EMITTER_INC) 
+	mv -f $(TEMP_EMITTER_INC) SparcV9CodeEmitter.inc
 
 clean::
 	rm -f SparcV9CodeEmitter.inc





More information about the llvm-commits mailing list