Cleanup LLVM code generation code.
Materialize the bitcode in the end of CompileClass,
so that the code generation time won't be calculated
in method compilation time.
Change-Id: I1e2bd0b23bcb5c55bd966a31b1df0b8b34922f94
diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/compilation_unit.h
index a10d977..2ae5c0b 100644
--- a/src/compiler_llvm/compilation_unit.h
+++ b/src/compiler_llvm/compilation_unit.h
@@ -56,12 +56,10 @@
}
std::string const& GetElfFileName() const {
- CHECK(IsFinalized());
return elf_filename_;
}
std::string const& GetBitcodeFileName() const {
- CHECK(IsFinalized());
return bitcode_filename_;
}
@@ -77,12 +75,10 @@
bool Materialize();
- bool IsFinalized() const {
+ bool IsMaterialized() const {
return (context_.get() == NULL);
}
- void Finalize();
-
bool IsMaterializeThresholdReached() const {
return (mem_usage_ > 300000000u); // (threshold: 300 MB)
}