OLD | NEW |
1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// |
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 implements the Cfg class, including constant pool | 10 // This file implements the Cfg class, including constant pool |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 397 |
398 void Cfg::emit() { | 398 void Cfg::emit() { |
399 TimerMarker T(TimerStack::TT_emit, this); | 399 TimerMarker T(TimerStack::TT_emit, this); |
400 Ostream &Str = Ctx->getStrEmit(); | 400 Ostream &Str = Ctx->getStrEmit(); |
401 if (!Ctx->testAndSetHasEmittedFirstMethod()) { | 401 if (!Ctx->testAndSetHasEmittedFirstMethod()) { |
402 // Print a helpful command for assembling the output. | 402 // Print a helpful command for assembling the output. |
403 // TODO: have the Target emit the header | 403 // TODO: have the Target emit the header |
404 // TODO: need a per-file emit in addition to per-CFG | 404 // TODO: need a per-file emit in addition to per-CFG |
405 Str << "# $LLVM_BIN_PATH/llvm-mc" | 405 Str << "# $LLVM_BIN_PATH/llvm-mc" |
406 << " -arch=x86" | 406 << " -arch=x86" |
407 << " -x86-asm-syntax=intel" | |
408 << " -filetype=obj" | 407 << " -filetype=obj" |
409 << " -o=MyObj.o" | 408 << " -o=MyObj.o" |
410 << "\n\n"; | 409 << "\n\n"; |
411 } | 410 } |
412 Str << "\t.text\n"; | 411 Str << "\t.text\n"; |
413 IceString MangledName = getContext()->mangleName(getFunctionName()); | 412 IceString MangledName = getContext()->mangleName(getFunctionName()); |
414 if (Ctx->getFlags().FunctionSections) | 413 if (Ctx->getFlags().FunctionSections) |
415 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; | 414 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; |
416 if (!getInternal() || Ctx->getFlags().DisableInternal) { | 415 if (!getInternal() || Ctx->getFlags().DisableInternal) { |
417 Str << "\t.globl\t" << MangledName << "\n"; | 416 Str << "\t.globl\t" << MangledName << "\n"; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 } | 462 } |
464 } | 463 } |
465 // Print each basic block | 464 // Print each basic block |
466 for (CfgNode *Node : Nodes) | 465 for (CfgNode *Node : Nodes) |
467 Node->dump(this); | 466 Node->dump(this); |
468 if (getContext()->isVerbose(IceV_Instructions)) | 467 if (getContext()->isVerbose(IceV_Instructions)) |
469 Str << "}\n"; | 468 Str << "}\n"; |
470 } | 469 } |
471 | 470 |
472 } // end of namespace Ice | 471 } // end of namespace Ice |
OLD | NEW |