From d52db719cda58b67577eedb3ee542097b17a4024 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 2 Aug 2021 01:00:39 -0700 Subject: [PATCH] scons: Delete the unused do_embed_text function. Change-Id: I2ad37c9965e7a58e288711f0fa5bb1858f121c05 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48968 Tested-by: kokoro Reviewed-by: Hoa Nguyen Maintainer: Gabe Black --- src/mem/ruby/SConscript | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/mem/ruby/SConscript b/src/mem/ruby/SConscript index c3f8365594..b3ea716699 100644 --- a/src/mem/ruby/SConscript +++ b/src/mem/ruby/SConscript @@ -61,36 +61,6 @@ CompoundFlag('Ruby', [ 'RubyQueue', 'RubyNetwork', 'RubyTester', 'RubyDma', 'RubyPort', 'RubySequencer', 'RubyCacheTrace', 'RubyPrefetcher']) -def do_embed_text(target, source, env): - """convert a text file into a file that can be embedded in C - using an #include statement, that defines a \"const char *\" pointing - to the same text. - - This is useful to embed scripts and configuration files in object files. - """ - - escape = [ "\'", "\"", "\\", "\?" ] - - # reads the text file in, line by line, converting it to a C string - fin = open(str(source[0]), 'r') - fout = open(str(target[0]), 'w' ) - fout.write("static const char *%s =\n" % source[1].get_contents()); - for l in fin: - # add escape sequences for the characters in escape - fout.write("\"") - for char in l: - if char == "\n": - break - if char in escape: - fout.write("\\") - fout.write(char) - else: - fout.write(char) - fout.write("\\n\"\n"); - fout.write(";\n"); - fin.close() - fout.close() - # # Link includes #