From 2a915e2654ed38497c317bb1a1a0e9d8239a325c Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Thu, 30 Jul 2020 11:07:41 -0600 Subject: [PATCH] Fix LLVM template --- backend/src/langs.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/backend/src/langs.ts b/backend/src/langs.ts index 9aef3aa..8a9f8ae 100644 --- a/backend/src/langs.ts +++ b/backend/src/langs.ts @@ -1000,26 +1000,15 @@ PLEASE GIVE UP main: "main.ll", compile: "clang -Wno-override-module main.ll -o main", run: "./main", - template: `; Copied directly from the documentation -; Declare the string constant as a global constant. -@.str = private unnamed_addr constant [13 x i8] c"hello world\\0A\\00" + template: `@.str = private unnamed_addr constant [13 x i8] c"Hello, world!" -; External declaration of the puts function declare i32 @puts(i8* nocapture) nounwind -; Definition of main function -define i32 @main() { ; i32()* - ; Convert [13 x i8]* to i8 *... +define i32 @main() { %cast210 = getelementptr [13 x i8],[13 x i8]* @.str, i64 0, i64 0 - - ; Call puts function to write out the string to stdout. call i32 @puts(i8* %cast210) ret i32 0 } - -; Named metadata -!0 = !{i32 42, null, !"string"} -!foo = !{!0} `, }, lolcode: {