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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 1848303003: Simplify references to command line flags. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 8 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/IceTargetLoweringMIPS32.cpp ('k') | src/IceTargetLoweringX8632Traits.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/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
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
(...skipping 17 matching lines...) Expand all
28 Ctx); 28 Ctx);
29 } 29 }
30 30
31 std::unique_ptr<::Ice::TargetHeaderLowering> 31 std::unique_ptr<::Ice::TargetHeaderLowering>
32 createTargetHeaderLowering(::Ice::GlobalContext *Ctx) { 32 createTargetHeaderLowering(::Ice::GlobalContext *Ctx) {
33 return ::Ice::X8632::TargetHeaderX86::create(Ctx); 33 return ::Ice::X8632::TargetHeaderX86::create(Ctx);
34 } 34 }
35 35
36 void staticInit(::Ice::GlobalContext *Ctx) { 36 void staticInit(::Ice::GlobalContext *Ctx) {
37 ::Ice::X8632::TargetX8632::staticInit(Ctx); 37 ::Ice::X8632::TargetX8632::staticInit(Ctx);
38 if (Ctx->getFlags().getUseNonsfi()) { 38 if (Ice::getFlags().getUseNonsfi()) {
39 // In nonsfi, we need to reference the _GLOBAL_OFFSET_TABLE_ for accessing 39 // In nonsfi, we need to reference the _GLOBAL_OFFSET_TABLE_ for accessing
40 // globals. The GOT is an external symbol (i.e., it is not defined in the 40 // globals. The GOT is an external symbol (i.e., it is not defined in the
41 // pexe) so we need to register it as such so that ELF emission won't barf 41 // pexe) so we need to register it as such so that ELF emission won't barf
42 // on an "unknown" symbol. The GOT is added to the External symbols list 42 // on an "unknown" symbol. The GOT is added to the External symbols list
43 // here because staticInit() is invoked in a single-thread context. 43 // here because staticInit() is invoked in a single-thread context.
44 Ctx->getConstantExternSym(Ctx->getGlobalString(::Ice::GlobalOffsetTable)); 44 Ctx->getConstantExternSym(Ctx->getGlobalString(::Ice::GlobalOffsetTable));
45 } 45 }
46 } 46 }
47 47
48 bool shouldBePooled(const class ::Ice::Constant *C) { 48 bool shouldBePooled(const class ::Ice::Constant *C) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void TargetX8632::_push_reg(Variable *Reg) { _push(Reg); } 220 void TargetX8632::_push_reg(Variable *Reg) { _push(Reg); }
221 221
222 void TargetX8632::emitGetIP(CfgNode *Node) { 222 void TargetX8632::emitGetIP(CfgNode *Node) {
223 // If there is a non-deleted InstX86GetIP instruction, we need to move it to 223 // If there is a non-deleted InstX86GetIP instruction, we need to move it to
224 // the point after the stack frame has stabilized but before 224 // the point after the stack frame has stabilized but before
225 // register-allocated in-args are copied into their home registers. It would 225 // register-allocated in-args are copied into their home registers. It would
226 // be slightly faster to search for the GetIP instruction before other prolog 226 // be slightly faster to search for the GetIP instruction before other prolog
227 // instructions are inserted, but it's more clear to do the whole 227 // instructions are inserted, but it's more clear to do the whole
228 // transformation in a single place. 228 // transformation in a single place.
229 Traits::Insts::GetIP *GetIPInst = nullptr; 229 Traits::Insts::GetIP *GetIPInst = nullptr;
230 if (Ctx->getFlags().getUseNonsfi()) { 230 if (getFlags().getUseNonsfi()) {
231 for (Inst &Instr : Node->getInsts()) { 231 for (Inst &Instr : Node->getInsts()) {
232 if (auto *GetIP = llvm::dyn_cast<Traits::Insts::GetIP>(&Instr)) { 232 if (auto *GetIP = llvm::dyn_cast<Traits::Insts::GetIP>(&Instr)) {
233 if (!Instr.isDeleted()) 233 if (!Instr.isDeleted())
234 GetIPInst = GetIP; 234 GetIPInst = GetIP;
235 break; 235 break;
236 } 236 }
237 } 237 }
238 } 238 }
239 // Delete any existing InstX86GetIP instruction and reinsert it here. Also, 239 // Delete any existing InstX86GetIP instruction and reinsert it here. Also,
240 // insert the call to the helper function and the spill to the stack, to 240 // insert the call to the helper function and the spill to the stack, to
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \ 482 #define X(tag, sizeLog2, align, elts, elty, str, rcstr) \
483 static_assert(_table1_##tag == _table2_##tag, \ 483 static_assert(_table1_##tag == _table2_##tag, \
484 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); 484 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE");
485 ICETYPE_TABLE 485 ICETYPE_TABLE
486 #undef X 486 #undef X
487 } // end of namespace dummy3 487 } // end of namespace dummy3
488 } // end of anonymous namespace 488 } // end of anonymous namespace
489 489
490 } // end of namespace X8632 490 } // end of namespace X8632
491 } // end of namespace Ice 491 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | src/IceTargetLoweringX8632Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698