Subzero: Manage each Cfg as a std::unique_ptr<Cfg>.
The Cfg::create() method now returns a unique_ptr. Once the parser fully builds the Cfg, it is released onto the work queue, and then acquired and ultimately deleted by the translator thread.
BUG= none
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/892063002
diff --git a/src/IceTranslator.cpp b/src/IceTranslator.cpp
index c05f58d..4753b22 100644
--- a/src/IceTranslator.cpp
+++ b/src/IceTranslator.cpp
@@ -53,8 +53,8 @@
return false;
}
-void Translator::translateFcn(Cfg *Func) {
- Ctx->cfgQueueBlockingPush(Func);
+void Translator::translateFcn(std::unique_ptr<Cfg> Func) {
+ Ctx->cfgQueueBlockingPush(std::move(Func));
if (Ctx->getFlags().NumTranslationThreads == 0) {
Ctx->translateFunctions();
}