Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: src/IceTranslator.cpp

Issue 1804133002: Subzero. Uses unique_ptrs in the emit queue. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTranslator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTranslator.cpp
diff --git a/src/IceTranslator.cpp b/src/IceTranslator.cpp
index 01fb537c2bd4bf34ee7dc76659c772e097fb84b0..ce54c218405d6c7466715f73b76ed27096728b75 100644
--- a/src/IceTranslator.cpp
+++ b/src/IceTranslator.cpp
@@ -14,13 +14,15 @@
#include "IceTranslator.h"
+#include "IceDefs.h"
#include "IceCfg.h"
#include "IceClFlags.h"
-#include "IceDefs.h"
#include "IceGlobalInits.h"
#include "IceTargetLowering.h"
-using namespace Ice;
+#include <utility>
+
+namespace Ice {
Translator::Translator(GlobalContext *Ctx)
: Ctx(Ctx), NextSequenceNumber(GlobalContext::getFirstSequenceNumber()),
@@ -58,7 +60,8 @@ void Translator::translateFcn(std::unique_ptr<Cfg> Func) {
void Translator::lowerGlobals(
std::unique_ptr<VariableDeclarationList> VariableDeclarations) {
- EmitterWorkItem *Item = new EmitterWorkItem(getNextSequenceNumber(),
- VariableDeclarations.release());
- Ctx->emitQueueBlockingPush(Item);
+ Ctx->emitQueueBlockingPush(makeUnique<EmitterWorkItem>(
+ getNextSequenceNumber(), std::move(VariableDeclarations)));
}
+
+} // end of namespace Ice
« no previous file with comments | « src/IceTranslator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698