clippy the original clipper

This commit is contained in:
Richard Feldman 2020-04-01 00:03:27 -04:00
parent dfa514c1fe
commit 63b38ae174
3 changed files with 4 additions and 5 deletions

View file

@ -7,7 +7,7 @@ if ($num_args != 1) {
} }
my $filename = $ARGV[0]; my $filename = $ARGV[0];
my $before_bitcode = "// GENERATED FILE - NEVER EDIT BY HAND!\n//\n// See compiler/builtins/bitcode/README.md for how to generate.\n\npub const BUILTINS_BITCODE: &'static [u8] = &[\n "; my $before_bitcode = "// GENERATED FILE - NEVER EDIT BY HAND!\n//\n// See compiler/builtins/bitcode/README.md for how to generate.\n\npub const BUILTINS_BITCODE: &[u8] = &[\n ";
my $after_bitcode = "\n];"; my $after_bitcode = "\n];";
# Get a filehandle to the raw binary data in the file # Get a filehandle to the raw binary data in the file

View file

@ -51,10 +51,9 @@ impl<'a, 'ctx, 'env> Env<'a, 'ctx, 'env> {
pub fn module_from_builtins<'ctx>(ctx: &'ctx Context, module_name: &str) -> Module<'ctx> { pub fn module_from_builtins<'ctx>(ctx: &'ctx Context, module_name: &str) -> Module<'ctx> {
let memory_buffer = MemoryBuffer::create_from_memory_range(BUILTINS_BITCODE, module_name); let memory_buffer = MemoryBuffer::create_from_memory_range(BUILTINS_BITCODE, module_name);
let module = Module::parse_bitcode_from_buffer(&memory_buffer, ctx)
.unwrap_or_else(|err| panic!("Unable to import builtins bitcode. LLVM error: {:?}", err));
module Module::parse_bitcode_from_buffer(&memory_buffer, ctx)
.unwrap_or_else(|err| panic!("Unable to import builtins bitcode. LLVM error: {:?}", err))
} }
pub fn add_passes(fpm: &PassManager<FunctionValue<'_>>) { pub fn add_passes(fpm: &PassManager<FunctionValue<'_>>) {

View file

@ -2,7 +2,7 @@
// //
// See compiler/builtins/bitcode/README.md for how to generate. // See compiler/builtins/bitcode/README.md for how to generate.
pub const BUILTINS_BITCODE: &'static [u8] = &[ pub const BUILTINS_BITCODE: &[u8] = &[
66, 67, 192, 222, 53, 20, 0, 0, 14, 0, 0, 0, 98, 12, 48, 28, 1, 199, 10, 172, 96, 11, 173, 144, 66, 67, 192, 222, 53, 20, 0, 0, 14, 0, 0, 0, 98, 12, 48, 28, 1, 199, 10, 172, 96, 11, 173, 144,
7, 110, 0, 7, 110, 16, 7, 109, 32, 15, 245, 48, 15, 244, 208, 6, 113, 224, 6, 116, 32, 7, 110, 7, 110, 0, 7, 110, 16, 7, 109, 32, 15, 245, 48, 15, 244, 208, 6, 113, 224, 6, 116, 32, 7, 110,
0, 7, 109, 48, 15, 244, 16, 14, 226, 192, 14, 229, 32, 68, 1, 50, 5, 0, 0, 0, 0, 33, 12, 0, 0, 0, 7, 109, 48, 15, 244, 16, 14, 226, 192, 14, 229, 32, 68, 1, 50, 5, 0, 0, 0, 0, 33, 12, 0, 0,