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