Chromium Code Reviews| Index: src/IceTranslator.cpp |
| diff --git a/src/IceTranslator.cpp b/src/IceTranslator.cpp |
| index ce54c218405d6c7466715f73b76ed27096728b75..238663aacd7bd5ae851ec3269b5eee1e57b053f3 100644 |
| --- a/src/IceTranslator.cpp |
| +++ b/src/IceTranslator.cpp |
| @@ -22,6 +22,24 @@ |
| #include <utility> |
| +namespace { |
|
John
2016/03/24 17:32:35
enclose this namespace in Ice, and then remove the
Karl
2016/03/24 22:35:25
Done.
|
| + |
| +class CfgOptWorkItem : public Ice::OptWorkItem { |
| + CfgOptWorkItem() = delete; |
| + CfgOptWorkItem(const CfgOptWorkItem &) = delete; |
| + CfgOptWorkItem &operator=(const CfgOptWorkItem &) = delete; |
| + |
| +public: |
| + CfgOptWorkItem(std::unique_ptr<Ice::Cfg> Func) : Func(std::move(Func)) {} |
| + std::unique_ptr<Ice::Cfg> getParsedCfg() final { return std::move(Func); } |
|
John
2016/03/24 17:32:34
final is better off when used in the class declara
Karl
2016/03/24 22:35:25
On 2016/03/24 17:32:34, John wrote:
> final is bet
|
| + ~CfgOptWorkItem() final {} |
|
John
2016/03/24 17:32:35
~CfgOptWorkItem() override = default;
Karl
2016/03/24 22:35:25
Done.
|
| + |
| +private: |
| + std::unique_ptr<Ice::Cfg> Func; |
| +}; |
| + |
| +} // end of anonymous namespace |
| + |
| namespace Ice { |
| Translator::Translator(GlobalContext *Ctx) |
| @@ -55,7 +73,7 @@ bool Translator::checkIfUnnamedNameSafe(const IceString &Name, const char *Kind, |
| } |
| void Translator::translateFcn(std::unique_ptr<Cfg> Func) { |
| - Ctx->optQueueBlockingPush(std::move(Func)); |
| + Ctx->optQueueBlockingPush(makeUnique<CfgOptWorkItem>(std::move(Func))); |
| } |
| void Translator::lowerGlobals( |