From a19f11851043b3f13ea9484e9862154a31feab53 Mon Sep 17 00:00:00 2001 From: Natapat Samutpong Date: Sat, 12 Mar 2022 10:38:18 +0700 Subject: [PATCH] generate comment --- .gitignore | 6 +++++- crates/codegen/src/cpp.rs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 71ab9a4..4709b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,8 @@ target/ **/*.rs.bk # MSVC Windows builds of rustc generate these, which store debugging information -*.pdb \ No newline at end of file +*.pdb + +# Generated by the compiler +/*.cpp +/*.out \ No newline at end of file diff --git a/crates/codegen/src/cpp.rs b/crates/codegen/src/cpp.rs index 6778a88..172d9e0 100644 --- a/crates/codegen/src/cpp.rs +++ b/crates/codegen/src/cpp.rs @@ -22,6 +22,8 @@ impl Codegen { } pub fn gen(&mut self, irs: Vec) { + self.emit(format!("// Auto-generated by hazure compiler version {}\n", env!("CARGO_PKG_VERSION"))); + for module in MODULE_INCLUDES { self.emit(format!("#include {}\n", module)); }