Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 //===- subzero/src/IceTranslator.cpp - Translate IR to ICE ------*- C++ -*-===// | |
| 2 // | |
| 3 // The Subzero Code Generator | |
| 4 // | |
| 5 // This file is distributed under the University of Illinois Open Source | |
| 6 // License. See LICENSE.TXT for details. | |
| 7 // | |
| 8 //===----------------------------------------------------------------------===// | |
| 9 // | |
| 10 // This file defines the general driver class for translating IR to ICE. | |
| 
 
jvoung (off chromium)
2014/07/02 17:00:15
Similar comment -- this file doesn't seem to touch
 
Karl
2014/07/02 18:09:54
Done.
 
 | |
| 11 // | |
| 12 //===----------------------------------------------------------------------===// | |
| 13 | |
| 14 #include "IceTranslator.h" | |
| 15 | |
| 16 #include "IceCfg.h" | |
| 17 #include "IceClFlags.h" | |
| 18 #include "IceTargetLowering.h" | |
| 19 | |
| 20 #include <iostream> | |
| 21 | |
| 22 using namespace Ice; | |
| 23 | |
| 24 Translator::~Translator() {} | |
| 25 | |
| 26 void Translator::translateFcn(Ice::Cfg *Fcn) { | |
| 27 Func.reset(Fcn); | |
| 28 if (Flags.DisableInternal) | |
| 29 Func->setInternal(false); | |
| 30 if (Flags.DisableTranslation) { | |
| 31 Func->dump(); | |
| 32 } else { | |
| 33 Ice::Timer TTranslate; | |
| 34 Func->translate(); | |
| 35 if (Flags.SubzeroTimingEnabled) { | |
| 36 std::cerr << "[Subzero timing] Translate function " | |
| 37 << Func->getFunctionName() << ": " << TTranslate.getElapsedSec() | |
| 38 << " sec\n"; | |
| 39 } | |
| 40 if (Func->hasError()) { | |
| 41 std::cerr << "ICE translation error: " << Func->getError() << "\n"; | |
| 42 ExitStatus = 1; | |
| 43 } | |
| 44 | |
| 45 Ice::Timer TEmit; | |
| 46 Func->emit(); | |
| 47 if (Flags.SubzeroTimingEnabled) { | |
| 48 std::cerr << "[Subzero timing] Emit function " << Func->getFunctionName() | |
| 49 << ": " << TEmit.getElapsedSec() << " sec\n"; | |
| 50 } | |
| 51 } | |
| 52 } | |
| 53 | |
| 54 void Translator::emitConstants() { | |
| 55 if (!Flags.DisableTranslation && Func) | |
| 56 Func->getTarget()->emitConstants(); | |
| 57 } | |
| OLD | NEW |