Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: src/IceTranslator.cpp

Issue 455633002: Subzero: Add the "llvm2ice -ffunction-sections" argument. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTranslator.h ('k') | src/PNaClTranslator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "IceTranslator.h" 15 #include "IceTranslator.h"
16 16
17 #include "IceCfg.h" 17 #include "IceCfg.h"
18 #include "IceClFlags.h" 18 #include "IceClFlags.h"
19 #include "IceTargetLowering.h" 19 #include "IceTargetLowering.h"
20 20
21 #include <iostream> 21 #include <iostream>
22 22
23 using namespace Ice; 23 using namespace Ice;
24 24
25 Translator::~Translator() {} 25 Translator::~Translator() {}
26 26
27 void Translator::translateFcn(Ice::Cfg *Fcn) { 27 void Translator::translateFcn(Ice::Cfg *Fcn) {
28 Func.reset(Fcn); 28 Func.reset(Fcn);
29 if (Flags.DisableInternal) 29 if (Ctx->getFlags().DisableInternal)
30 Func->setInternal(false); 30 Func->setInternal(false);
31 if (Flags.DisableTranslation) { 31 if (Ctx->getFlags().DisableTranslation) {
32 Func->dump(); 32 Func->dump();
33 } else { 33 } else {
34 Ice::Timer TTranslate; 34 Ice::Timer TTranslate;
35 Func->translate(); 35 Func->translate();
36 if (Flags.SubzeroTimingEnabled) { 36 if (Ctx->getFlags().SubzeroTimingEnabled) {
37 std::cerr << "[Subzero timing] Translate function " 37 std::cerr << "[Subzero timing] Translate function "
38 << Func->getFunctionName() << ": " << TTranslate.getElapsedSec() 38 << Func->getFunctionName() << ": " << TTranslate.getElapsedSec()
39 << " sec\n"; 39 << " sec\n";
40 } 40 }
41 if (Func->hasError()) { 41 if (Func->hasError()) {
42 std::cerr << "ICE translation error: " << Func->getError() << "\n"; 42 std::cerr << "ICE translation error: " << Func->getError() << "\n";
43 ErrorStatus = true; 43 ErrorStatus = true;
44 } 44 }
45 45
46 Ice::Timer TEmit; 46 Ice::Timer TEmit;
47 Func->emit(); 47 Func->emit();
48 if (Flags.SubzeroTimingEnabled) { 48 if (Ctx->getFlags().SubzeroTimingEnabled) {
49 std::cerr << "[Subzero timing] Emit function " << Func->getFunctionName() 49 std::cerr << "[Subzero timing] Emit function " << Func->getFunctionName()
50 << ": " << TEmit.getElapsedSec() << " sec\n"; 50 << ": " << TEmit.getElapsedSec() << " sec\n";
51 } 51 }
52 } 52 }
53 } 53 }
54 54
55 void Translator::emitConstants() { 55 void Translator::emitConstants() {
56 if (!Flags.DisableTranslation && Func) 56 if (!Ctx->getFlags().DisableTranslation && Func)
57 Func->getTarget()->emitConstants(); 57 Func->getTarget()->emitConstants();
58 } 58 }
OLDNEW
« no previous file with comments | « src/IceTranslator.h ('k') | src/PNaClTranslator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698