| 
    LLVM 22.0.0git
    
   | 
 
#include "MCTargetDesc/PPCInstPrinter.h"#include "MCTargetDesc/PPCMCAsmInfo.h"#include "MCTargetDesc/PPCMCTargetDesc.h"#include "MCTargetDesc/PPCPredicates.h"#include "MCTargetDesc/PPCTargetStreamer.h"#include "PPC.h"#include "PPCInstrInfo.h"#include "PPCMachineFunctionInfo.h"#include "PPCSubtarget.h"#include "PPCTargetMachine.h"#include "TargetInfo/PowerPCTargetInfo.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SetVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/StringRef.h"#include "llvm/ADT/Twine.h"#include "llvm/BinaryFormat/ELF.h"#include "llvm/CodeGen/AsmPrinter.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineModuleInfoImpls.h"#include "llvm/CodeGen/MachineOperand.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/StackMaps.h"#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/Module.h"#include "llvm/MC/MCAsmInfo.h"#include "llvm/MC/MCContext.h"#include "llvm/MC/MCDirectives.h"#include "llvm/MC/MCExpr.h"#include "llvm/MC/MCInst.h"#include "llvm/MC/MCInstBuilder.h"#include "llvm/MC/MCSectionELF.h"#include "llvm/MC/MCSectionXCOFF.h"#include "llvm/MC/MCStreamer.h"#include "llvm/MC/MCSymbol.h"#include "llvm/MC/MCSymbolELF.h"#include "llvm/MC/MCSymbolXCOFF.h"#include "llvm/MC/SectionKind.h"#include "llvm/MC/TargetRegistry.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CodeGen.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Error.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/Process.h"#include "llvm/Support/Threading.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetMachine.h"#include "llvm/TargetParser/PPCTargetParser.h"#include "llvm/TargetParser/Triple.h"#include "llvm/Transforms/Utils/ModuleUtils.h"#include <cassert>#include <cstdint>#include <memory>#include <new>Go to the source code of this file.
Classes | |
| struct | llvm::DenseMapInfo< std::pair< const MCSymbol *, PPCMCExpr::Specifier > > | 
Namespaces | |
| namespace | llvm | 
| This is an optimization pass for GlobalISel generic memory operations.  | |
Macros | |
| #define | DEBUG_TYPE "asmprinter" | 
| #define | GENBOOLCOMMENT(Prefix, V, Field) | 
| #define | GENVALUECOMMENT(PrefixAndName, V, Field) | 
Functions | |
| STATISTIC (NumTOCEntries, "Number of Total TOC Entries Emitted.") | |
| STATISTIC (NumTOCConstPool, "Number of Constant Pool TOC Entries.") | |
| STATISTIC (NumTOCGlobalInternal, "Number of Internal Linkage Global TOC Entries.") | |
| STATISTIC (NumTOCGlobalExternal, "Number of External Linkage Global TOC Entries.") | |
| STATISTIC (NumTOCJumpTable, "Number of Jump Table TOC Entries.") | |
| STATISTIC (NumTOCThreadLocal, "Number of Thread Local TOC Entries.") | |
| STATISTIC (NumTOCBlockAddress, "Number of Block Address TOC Entries.") | |
| STATISTIC (NumTOCEHBlock, "Number of EH Block TOC Entries.") | |
| static void | collectTOCStats (PPCAsmPrinter::TOCEntryType Type) | 
| static CodeModel::Model | getCodeModel (const PPCSubtarget &S, const TargetMachine &TM, const MachineOperand &MO) | 
| static void | setOptionalCodeModel (MCSymbolXCOFF *XSym, CodeModel::Model CM) | 
| static MCSymbol * | createMCSymbolForTlsGetAddr (MCContext &Ctx, unsigned MIOpc) | 
| This helper function creates the TlsGetAddr/TlsGetMod MCSymbol for AIX.   | |
| static MCSymbol * | getMCSymbolForTOCPseudoMO (const MachineOperand &MO, AsmPrinter &AP) | 
| Map a machine operand for a TOC pseudo-machine instruction to its corresponding MCSymbol.   | |
| static PPCAsmPrinter::TOCEntryType | getTOCEntryTypeForMO (const MachineOperand &MO) | 
| INITIALIZE_PASS (PPCLinuxAsmPrinter, "ppc-linux-asm-printer", "Linux PPC Assembly Printer", false, false) void PPCAIXAsmPrinter | |
| static bool | isSpecialLLVMGlobalArrayToSkip (const GlobalVariable *GV) | 
| static bool | isSpecialLLVMGlobalArrayForStaticInit (const GlobalVariable *GV) | 
| static void | tocDataChecks (unsigned PointerSize, const GlobalVariable *GV) | 
| static unsigned | mapToSinitPriority (int P) | 
| static std::string | convertToSinitPriority (int Priority) | 
| static AsmPrinter * | createPPCAsmPrinterPass (TargetMachine &tm, std::unique_ptr< MCStreamer > &&Streamer) | 
| INITIALIZE_PASS (PPCAIXAsmPrinter, "ppc-aix-asm-printer", "AIX PPC Assembly Printer", false, false) extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializePowerPCAsmPrinter() | |
Variables | |
| static cl::opt< bool > | EnableSSPCanaryBitInTB ("aix-ssp-tb-bit", cl::init(false), cl::desc("Enable Passing SSP Canary info in Trackback on AIX"), cl::Hidden) | 
| #define DEBUG_TYPE "asmprinter" | 
Definition at line 86 of file PPCAsmPrinter.cpp.
| #define GENBOOLCOMMENT | ( | Prefix, | |
| V, | |||
| Field ) | 
| #define GENVALUECOMMENT | ( | PrefixAndName, | |
| V, | |||
| Field ) | 
      
  | 
  static | 
Definition at line 454 of file PPCAsmPrinter.cpp.
      
  | 
  static | 
Definition at line 3268 of file PPCAsmPrinter.cpp.
References llvm::format_hex_no_prefix(), mapToSinitPriority(), and P.
This helper function creates the TlsGetAddr/TlsGetMod MCSymbol for AIX.
We will create the csect and use the qual-name symbol instead of creating just the external symbol.
Definition at line 661 of file PPCAsmPrinter.cpp.
References llvm::SectionKind::getText(), llvm::XCOFF::XMC_PR, and llvm::XCOFF::XTY_ER.
      
  | 
  static | 
Definition at line 3338 of file PPCAsmPrinter.cpp.
References llvm::TargetMachine::getTargetTriple(), and llvm::Triple::isOSAIX().
Referenced by INITIALIZE_PASS().
      
  | 
  static | 
Definition at line 481 of file PPCAsmPrinter.cpp.
References assert(), llvm::PPCSubtarget::getCodeModel(), llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getType(), and llvm::MachineOperand::MO_GlobalAddress.
Referenced by llvm::RISCVTargetLowering::getJumpTableEncoding(), llvm::X86TargetLowering::getJumpTableEncoding(), llvm::PPCTargetLowering::getPICJumpTableRelocBase(), llvm::PPCTargetLowering::getPICJumpTableRelocBaseExpr(), llvm::X86TargetLowering::getPICJumpTableRelocBaseExpr(), llvm::RISCVTargetLowering::LowerCall(), llvm::LanaiTargetLowering::LowerConstantPool(), llvm::RISCVTargetLowering::LowerCustomJumpTableEntry(), llvm::LanaiTargetLowering::LowerJumpTable(), llvm::SparcTargetLowering::makeAddress(), and llvm::VETargetLowering::makeAddress().
      
  | 
  static | 
Map a machine operand for a TOC pseudo-machine instruction to its corresponding MCSymbol.
Definition at line 755 of file PPCAsmPrinter.cpp.
References llvm::MachineOperand::getBlockAddress(), llvm::AsmPrinter::GetBlockAddressSymbol(), llvm::AsmPrinter::GetCPISymbol(), llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getIndex(), llvm::AsmPrinter::GetJTISymbol(), llvm::AsmPrinter::getSymbol(), llvm::MachineOperand::getType(), llvm_unreachable, llvm::MachineOperand::MO_BlockAddress, llvm::MachineOperand::MO_ConstantPoolIndex, llvm::MachineOperand::MO_GlobalAddress, and llvm::MachineOperand::MO_JumpTableIndex.
      
  | 
  static | 
Definition at line 772 of file PPCAsmPrinter.cpp.
References llvm::GlobalValue::AvailableExternallyLinkage, llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::ExternalWeakLinkage, llvm::MachineOperand::getGlobal(), llvm::GlobalValue::getLinkage(), llvm::MachineOperand::getTargetFlags(), llvm::MachineOperand::getType(), llvm::PPCInstrInfo::hasTLSFlag(), Linkage, llvm_unreachable, llvm::MachineOperand::MO_BlockAddress, llvm::MachineOperand::MO_ConstantPoolIndex, llvm::MachineOperand::MO_GlobalAddress, and llvm::MachineOperand::MO_JumpTableIndex.
| INITIALIZE_PASS | ( | PPCAIXAsmPrinter | , | 
| "ppc-aix-asm-printer" | , | ||
| "AIX PPC Assembly Printer" | , | ||
| false | , | ||
| false | ) | 
Definition at line 3368 of file PPCAsmPrinter.cpp.
References createPPCAsmPrinterPass(), llvm::getThePPC32LETarget(), llvm::getThePPC32Target(), llvm::getThePPC64LETarget(), llvm::getThePPC64Target(), LLVM_ABI, LLVM_EXTERNAL_VISIBILITY, and llvm::TargetRegistry::RegisterAsmPrinter().
| INITIALIZE_PASS | ( | PPCLinuxAsmPrinter | , | 
| "ppc-linux-asm-printer" | , | ||
| "Linux PPC Assembly Printer" | , | ||
| false | , | ||
| false | ) | 
Definition at line 2213 of file PPCAsmPrinter.cpp.
References assert(), const, and llvm::MCSA_Invalid.
      
  | 
  static | 
Definition at line 2703 of file PPCAsmPrinter.cpp.
References llvm::StringSwitch< T, R >::Cases(), Default, and llvm::Value::getName().
      
  | 
  static | 
Definition at line 2691 of file PPCAsmPrinter.cpp.
References llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), llvm::Value::getName(), and llvm::GlobalValue::hasAppendingLinkage().
      
  | 
  static | 
Definition at line 3249 of file PPCAsmPrinter.cpp.
References P, and llvm::report_fatal_error().
Referenced by convertToSinitPriority().
      
  | 
  static | 
Definition at line 497 of file PPCAsmPrinter.cpp.
References llvm::MCSymbolXCOFF::CM_Large, llvm::MCSymbolXCOFF::CM_Small, llvm::CodeModel::Large, llvm::report_fatal_error(), llvm::MCSymbolXCOFF::setPerSymbolCodeModel(), and llvm::CodeModel::Small.
| STATISTIC | ( | NumTOCBlockAddress | , | 
| "Number of Block Address TOC Entries." | ) | 
| STATISTIC | ( | NumTOCConstPool | , | 
| "Number of Constant Pool TOC Entries." | ) | 
| STATISTIC | ( | NumTOCEHBlock | , | 
| "Number of EH Block TOC Entries." | ) | 
| STATISTIC | ( | NumTOCEntries | , | 
| "Number of Total TOC Entries Emitted." | ) | 
| STATISTIC | ( | NumTOCGlobalExternal | , | 
| "Number of External Linkage Global TOC Entries." | ) | 
| STATISTIC | ( | NumTOCGlobalInternal | , | 
| "Number of Internal Linkage Global TOC Entries." | ) | 
| STATISTIC | ( | NumTOCJumpTable | , | 
| "Number of Jump Table TOC Entries." | ) | 
| STATISTIC | ( | NumTOCThreadLocal | , | 
| "Number of Thread Local TOC Entries." | ) | 
      
  | 
  static | 
Definition at line 2727 of file PPCAsmPrinter.cpp.
References assert(), llvm::GlobalVariable::getAlign(), llvm::GlobalValue::getDataLayout(), llvm::DataLayout::getTypeSizeInBits(), llvm::GlobalValue::getValueType(), llvm::GlobalValue::hasPrivateLinkage(), llvm::Type::isSized(), llvm::report_fatal_error(), llvm::Align::value(), and llvm::MaybeAlign::valueOrOne().