| 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 // This file defines the general driver class for translating ICE to | 10 // This file defines the general driver class for translating ICE to |
| 11 // machine code. | 11 // machine code. |
| 12 // | 12 // |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #include "IceCfg.h" | 15 #include "IceCfg.h" |
| 16 #include "IceClFlags.h" | 16 #include "IceClFlags.h" |
| 17 #include "IceDefs.h" | 17 #include "IceDefs.h" |
| 18 #include "IceGlobalInits.h" | 18 #include "IceGlobalInits.h" |
| 19 #include "IceTargetLowering.h" | 19 #include "IceTargetLowering.h" |
| 20 #include "IceTranslator.h" | 20 #include "IceTranslator.h" |
| 21 | 21 |
| 22 using namespace Ice; | 22 using namespace Ice; |
| 23 | 23 |
| 24 Translator::Translator(GlobalContext *Ctx) | 24 Translator::Translator(GlobalContext *Ctx) |
| 25 : Ctx(Ctx), NextSequenceNumber(GlobalContext::getFirstSequenceNumber()), | 25 : Ctx(Ctx), NextSequenceNumber(GlobalContext::getFirstSequenceNumber()), |
| 26 ErrorStatus() {} | 26 ErrorStatus() {} |
| 27 | 27 |
| 28 Translator::~Translator() {} | 28 Translator::~Translator() = default; |
| 29 | 29 |
| 30 IceString Translator::createUnnamedName(const IceString &Prefix, SizeT Index) { | 30 IceString Translator::createUnnamedName(const IceString &Prefix, SizeT Index) { |
| 31 if (Index == 0) | 31 if (Index == 0) |
| 32 return Prefix; | 32 return Prefix; |
| 33 std::string Buffer; | 33 std::string Buffer; |
| 34 llvm::raw_string_ostream StrBuf(Buffer); | 34 llvm::raw_string_ostream StrBuf(Buffer); |
| 35 StrBuf << Prefix << Index; | 35 StrBuf << Prefix << Index; |
| 36 return StrBuf.str(); | 36 return StrBuf.str(); |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 56 void Translator::translateFcn(std::unique_ptr<Cfg> Func) { | 56 void Translator::translateFcn(std::unique_ptr<Cfg> Func) { |
| 57 Ctx->optQueueBlockingPush(std::move(Func)); | 57 Ctx->optQueueBlockingPush(std::move(Func)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void Translator::lowerGlobals( | 60 void Translator::lowerGlobals( |
| 61 std::unique_ptr<VariableDeclarationList> VariableDeclarations) { | 61 std::unique_ptr<VariableDeclarationList> VariableDeclarations) { |
| 62 EmitterWorkItem *Item = new EmitterWorkItem(getNextSequenceNumber(), | 62 EmitterWorkItem *Item = new EmitterWorkItem(getNextSequenceNumber(), |
| 63 VariableDeclarations.release()); | 63 VariableDeclarations.release()); |
| 64 Ctx->emitQueueBlockingPush(Item); | 64 Ctx->emitQueueBlockingPush(Item); |
| 65 } | 65 } |
| OLD | NEW |