| OLD | NEW |
| 1 //===- subzero/src/IceTranslator.cpp - ICE to machine code ------*- C++ -*-===// | 1 //===- subzero/src/IceTranslator.cpp - ICE to machine code ------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| 11 /// \brief Defines the general driver class for translating ICE to machine code. | 11 /// \brief Defines the general driver class for translating ICE to machine code. |
| 12 /// | 12 /// |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #include "IceTranslator.h" | 15 #include "IceTranslator.h" |
| 16 | 16 |
| 17 #include "IceDefs.h" |
| 17 #include "IceCfg.h" | 18 #include "IceCfg.h" |
| 18 #include "IceClFlags.h" | 19 #include "IceClFlags.h" |
| 19 #include "IceDefs.h" | |
| 20 #include "IceGlobalInits.h" | 20 #include "IceGlobalInits.h" |
| 21 #include "IceTargetLowering.h" | 21 #include "IceTargetLowering.h" |
| 22 | 22 |
| 23 using namespace Ice; | 23 #include <utility> |
| 24 |
| 25 namespace Ice { |
| 24 | 26 |
| 25 Translator::Translator(GlobalContext *Ctx) | 27 Translator::Translator(GlobalContext *Ctx) |
| 26 : Ctx(Ctx), NextSequenceNumber(GlobalContext::getFirstSequenceNumber()), | 28 : Ctx(Ctx), NextSequenceNumber(GlobalContext::getFirstSequenceNumber()), |
| 27 ErrorStatus() {} | 29 ErrorStatus() {} |
| 28 | 30 |
| 29 IceString Translator::createUnnamedName(const IceString &Prefix, SizeT Index) { | 31 IceString Translator::createUnnamedName(const IceString &Prefix, SizeT Index) { |
| 30 if (Index == 0) | 32 if (Index == 0) |
| 31 return Prefix; | 33 return Prefix; |
| 32 std::string Buffer; | 34 std::string Buffer; |
| 33 llvm::raw_string_ostream StrBuf(Buffer); | 35 llvm::raw_string_ostream StrBuf(Buffer); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 } | 53 } |
| 52 return false; | 54 return false; |
| 53 } | 55 } |
| 54 | 56 |
| 55 void Translator::translateFcn(std::unique_ptr<Cfg> Func) { | 57 void Translator::translateFcn(std::unique_ptr<Cfg> Func) { |
| 56 Ctx->optQueueBlockingPush(std::move(Func)); | 58 Ctx->optQueueBlockingPush(std::move(Func)); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void Translator::lowerGlobals( | 61 void Translator::lowerGlobals( |
| 60 std::unique_ptr<VariableDeclarationList> VariableDeclarations) { | 62 std::unique_ptr<VariableDeclarationList> VariableDeclarations) { |
| 61 EmitterWorkItem *Item = new EmitterWorkItem(getNextSequenceNumber(), | 63 Ctx->emitQueueBlockingPush(makeUnique<EmitterWorkItem>( |
| 62 VariableDeclarations.release()); | 64 getNextSequenceNumber(), std::move(VariableDeclarations))); |
| 63 Ctx->emitQueueBlockingPush(Item); | |
| 64 } | 65 } |
| 66 |
| 67 } // end of namespace Ice |
| OLD | NEW |