summaryrefslogtreecommitdiff
path: root/Makefile.common
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-01-23 16:33:10 +0000
committerChris Lattner <sabre@nondot.org>2003-01-23 16:33:10 +0000
commit6d131b4582d0940c3ca3525ebfc281a4b5144b68 (patch)
tree2a256dee5a4e54dd1206802cf6db534698fbf6eb /Makefile.common
parent6520785dcd22012535934098942d57c07c7631c2 (diff)
downloadllvm-6d131b4582d0940c3ca3525ebfc281a4b5144b68.tar.gz
llvm-6d131b4582d0940c3ca3525ebfc281a4b5144b68.tar.bz2
llvm-6d131b4582d0940c3ca3525ebfc281a4b5144b68.tar.xz
Fix problem with flex scanners and huge token sizes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile.common b/Makefile.common
index 4d61ad7024..37cce15f70 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -467,8 +467,17 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
# Create a .cpp source file from a flex input file... this uses sed to cut down
# on the warnings emited by GCC...
+#
+# The last line is a gross hack to work around flex aparently not being able to
+# resize the buffer on a large token input. Currently, for uninitialized string
+# buffers in LLVM we can generate very long tokens, so this is a hack around it.
+# FIXME. (f.e. char Buffer[10000]; )
+#
%.cpp: %.l
- flex -t $< | sed '/^find_rule/d' | sed 's/void yyunput/inline void yyunput/' | sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' > $@
+ flex -t $< | sed '/^find_rule/d' | \
+ sed 's/void yyunput/inline void yyunput/' | \
+ sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
+ sed 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
# Rule for building the bison parsers...