|
120 | 120 | #include "llvm/Target/TargetLoweringObjectFile.h" |
121 | 121 | #include "llvm/Target/TargetMachine.h" |
122 | 122 | #include "llvm/Target/TargetOptions.h" |
123 | | -#include "llvm/TargetParser/PPCTargetParser.h" |
124 | 123 | #include "llvm/TargetParser/Triple.h" |
125 | 124 | #include <algorithm> |
126 | 125 | #include <cassert> |
@@ -520,28 +519,9 @@ bool AsmPrinter::doInitialization(Module &M) { |
520 | 519 | } |
521 | 520 | } |
522 | 521 |
|
523 | | - if (Target.isOSBinFormatXCOFF()) { |
524 | | - // Emit .machine directive on AIX. |
525 | | - XCOFF::CFileCpuId TargetCpuId = XCOFF::TCPU_INVALID; |
526 | | - // Walk through the "target-cpu" attribute of functions and use the newest |
527 | | - // level as the CPU of the module. |
528 | | - for (auto &F : M) { |
529 | | - XCOFF::CFileCpuId FunCpuId = |
530 | | - XCOFF::getCpuID(TM.getSubtargetImpl(F)->getCPU()); |
531 | | - if (FunCpuId > TargetCpuId) |
532 | | - TargetCpuId = FunCpuId; |
533 | | - } |
534 | | - // If there is no "target-cpu" attribute in functions, take the "-mcpu" |
535 | | - // value. If both are omitted, use getNormalizedPPCTargetCPU() to determine |
536 | | - // the default CPU. |
537 | | - if (!TargetCpuId) |
538 | | - TargetCpuId = XCOFF::getCpuID(TM.getTargetCPU().empty() |
539 | | - ? PPC::getNormalizedPPCTargetCPU(Target) |
540 | | - : TM.getTargetCPU()); |
541 | | - OutStreamer->emitMachineDirective(XCOFF::getTCPUString(TargetCpuId)); |
542 | | - |
543 | | - // On AIX, emit bytes for llvm.commandline metadata after .file so that the |
544 | | - // C_INFO symbol is preserved if any csect is kept by the linker. |
| 522 | + // On AIX, emit bytes for llvm.commandline metadata after .file so that the |
| 523 | + // C_INFO symbol is preserved if any csect is kept by the linker. |
| 524 | + if (TM.getTargetTriple().isOSBinFormatXCOFF()) { |
545 | 525 | emitModuleCommandLines(M); |
546 | 526 | // Now we can generate section information. |
547 | 527 | OutStreamer->initSections(false, *TM.getMCSubtargetInfo()); |
|
0 commit comments