diff --git a/bin/serene.cpp b/bin/serene.cpp index 35fa067..582839b 100644 --- a/bin/serene.cpp +++ b/bin/serene.cpp @@ -166,25 +166,25 @@ int dumpAsObject(Namespace &ns) { llvm::outs() << "Wrote " << filename << "\n"; - clang::IntrusiveRefCntPtr diagID( - new clang::DiagnosticIDs()); - clang::IntrusiveRefCntPtr diagOpts = - new clang::DiagnosticOptions(); - clang::TextDiagnosticPrinter diagPrinter(llvm::errs(), &*diagOpts); - clang::DiagnosticsEngine diags(diagID, &*diagOpts, &diagPrinter); - clang::driver::Driver d("clang", targetTriple, diags, "Serene compiler"); - std::vector args; + llvm::IntrusiveRefCntPtr opts = + new clang::DiagnosticOptions; + clang::DiagnosticsEngine diags( + new clang::DiagnosticIDs, opts, + new clang::TextDiagnosticPrinter(llvm::errs(), opts.get())); - args.push_back(filename); - args.push_back("-o"); - args.push_back( + clang::driver::Driver d("clang", targetTriple, diags, "Serene compiler"); + std::vector args = {"hnt"}; + auto objf = llvm::formatv("/home/lxsameer/src/serene/serene/build/{0}.o", filename) - .str() - .c_str()); + .str(); + args.push_back(objf.c_str()); + args.push_back("-o"); + args.push_back(filename); d.setCheckInputsExist(false); - const std::unique_ptr compilation( - d.BuildCompilation(args)); + + std::unique_ptr compilation; + compilation.reset(d.BuildCompilation(args)); if (!compilation) { return 1; diff --git a/docs/videos.org b/docs/videos.org index e6199d5..8693cfb 100644 --- a/docs/videos.org +++ b/docs/videos.org @@ -39,7 +39,7 @@ CLOSED: [2021-07-10 Sat 09:04] - Lexical analyzer (Lexer) - Syntax analyzer (Parser) - Semantic analyzer -- Middeend +- Middleend - Intermediate code generation - Code optimizer - Backend diff --git a/resources/museum/first_executable_2021_07_12 b/resources/museum/first_executable_2021_07_12 new file mode 100755 index 0000000..6b9b7ea Binary files /dev/null and b/resources/museum/first_executable_2021_07_12 differ diff --git a/resources/museum/first_object_file_2021_06_29 b/resources/museum/first_object_file_2021_06_29 new file mode 100644 index 0000000..0f83cc4 Binary files /dev/null and b/resources/museum/first_object_file_2021_06_29 differ