LLVM API Documentation

llvm::LLVMTargetMachine Class Reference

#include <TargetMachine.h>

Inheritance diagram for llvm::LLVMTargetMachine:
[legend]
Collaboration diagram for llvm::LLVMTargetMachine:
[legend]

List of all members.

Public Member Functions

virtual FileModel::Model addPassesToEmitFile (PassManagerBase &PM, raw_ostream &Out, CodeGenFileType FileType, bool Fast)
virtual bool addPassesToEmitFileFinish (PassManagerBase &PM, MachineCodeEmitter *MCE, bool Fast)
virtual bool addPassesToEmitMachineCode (PassManagerBase &PM, MachineCodeEmitter &MCE, bool Fast)
virtual bool addInstSelector (PassManagerBase &, bool)
 Target-Independent Code Generator Pass Configuration Options.
virtual bool addPreRegAlloc (PassManagerBase &, bool)
virtual bool addPostRegAlloc (PassManagerBase &, bool)
virtual bool addPreEmitPass (PassManagerBase &, bool)
virtual bool addAssemblyEmitter (PassManagerBase &, bool, raw_ostream &)
virtual bool addCodeEmitter (PassManagerBase &, bool, bool, MachineCodeEmitter &)
virtual bool addSimpleCodeEmitter (PassManagerBase &, bool, bool, MachineCodeEmitter &)
virtual bool getEnableTailMergeDefault () const

Protected Member Functions

 LLVMTargetMachine ()
bool addCommonCodeGenPasses (PassManagerBase &, bool)


Detailed Description

LLVMTargetMachine - This class describes a target machine that is implemented with the LLVM target-independent code generator.

Definition at line 239 of file TargetMachine.h.


Constructor & Destructor Documentation

llvm::LLVMTargetMachine::LLVMTargetMachine (  )  [inline, protected]

Definition at line 241 of file TargetMachine.h.


Member Function Documentation

bool LLVMTargetMachine::addCommonCodeGenPasses ( PassManagerBase &  PM,
bool  Fast 
) [protected]

FileModel::Model LLVMTargetMachine::addPassesToEmitFile ( PassManagerBase &  PM,
raw_ostream &  Out,
CodeGenFileType  FileType,
bool  Fast 
) [virtual]

addPassesToEmitFile - Add passes to the specified pass manager to get the specified file emitted. Typically this will involve several steps of code generation. If Fast is set to true, the code generator should emit code as fast as possible, though the generated code may be less efficient. This method should return FileModel::Error if emission of this file type is not supported.

The default implementation of this method adds components from the LLVM retargetable code generator, invoking the methods below to get target-specific passes in standard locations.

Reimplemented from llvm::TargetMachine.

Definition at line 64 of file LLVMTargetMachine.cpp.

References llvm::PassManagerBase::add(), addAssemblyEmitter(), addCommonCodeGenPasses(), addPreEmitPass(), llvm::FileModel::AsmFile, llvm::TargetMachine::AssemblyFile, llvm::cerr(), llvm::createDebugLabelFoldingPass(), llvm::createLoopAlignerPass(), llvm::createMachineFunctionPrinterPass(), llvm::FileModel::ElfFile, llvm::FileModel::Error, llvm::TargetMachine::getELFWriterInfo(), llvm::TargetMachine::getMachOWriterInfo(), llvm::FileModel::MachOFile, llvm::TargetMachine::ObjectFile, and llvm::PrintMachineCode.

bool LLVMTargetMachine::addPassesToEmitFileFinish ( PassManagerBase &  PM,
MachineCodeEmitter *  MCE,
bool  Fast 
) [virtual]

addPassesToEmitFileFinish - If the passes to emit the specified file had to be split up (e.g., to add an object writer pass), this method can be used to finish up adding passes to emit the file, if necessary.

addPassesToEmitFileFinish - If the passes to emit the specified file had to be split up (e.g., to add an object writer pass), this method can be used to finish up adding passes to emit the file, if necessary.

Reimplemented from llvm::TargetMachine.

Definition at line 104 of file LLVMTargetMachine.cpp.

References llvm::PassManagerBase::add(), addSimpleCodeEmitter(), llvm::createGCInfoDeleter(), llvm::createMachineCodeDeleter(), and PrintEmittedAsm.

bool LLVMTargetMachine::addPassesToEmitMachineCode ( PassManagerBase &  PM,
MachineCodeEmitter &  MCE,
bool  Fast 
) [virtual]

addPassesToEmitMachineCode - Add passes to the specified pass manager to get machine code emitted. This uses a MachineCodeEmitter object to handle actually outputting the machine code and resolving things like the address of functions. This method returns true if machine code emission is not supported.

addPassesToEmitMachineCode - Add passes to the specified pass manager to get machine code emitted. This uses a MachineCodeEmitter object to handle actually outputting the machine code and resolving things like the address of functions. This method should returns true if machine code emission is not supported.

Reimplemented from llvm::TargetMachine.

Definition at line 124 of file LLVMTargetMachine.cpp.

References llvm::PassManagerBase::add(), addCodeEmitter(), addCommonCodeGenPasses(), addPreEmitPass(), llvm::cerr(), llvm::createGCInfoDeleter(), llvm::createMachineCodeDeleter(), llvm::createMachineFunctionPrinterPass(), PrintEmittedAsm, and llvm::PrintMachineCode.

virtual bool llvm::LLVMTargetMachine::addInstSelector ( PassManagerBase &  ,
bool   
) [inline, virtual]

Target-Independent Code Generator Pass Configuration Options.

addInstSelector - This method should add any "last minute" LLVM->LLVM passes, then install an instruction selector pass, which converts from LLVM code to machine instructions.

Reimplemented in llvm::AlphaTargetMachine, llvm::ARMTargetMachine, llvm::SPUTargetMachine, llvm::IA64TargetMachine, llvm::MipsTargetMachine, llvm::PIC16TargetMachine, llvm::PPCTargetMachine, llvm::SparcTargetMachine, llvm::X86TargetMachine, and llvm::XCoreTargetMachine.

Definition at line 287 of file TargetMachine.h.

Referenced by addCommonCodeGenPasses().

virtual bool llvm::LLVMTargetMachine::addPreRegAlloc ( PassManagerBase &  ,
bool   
) [inline, virtual]

addPreRegAllocPasses - This method may be implemented by targets that want to run passes immediately before register allocation. This should return true if -print-machineinstrs should print after these passes.

Reimplemented in llvm::X86TargetMachine.

Definition at line 294 of file TargetMachine.h.

Referenced by addCommonCodeGenPasses().

virtual bool llvm::LLVMTargetMachine::addPostRegAlloc ( PassManagerBase &  ,
bool   
) [inline, virtual]

addPostRegAllocPasses - This method may be implemented by targets that want to run passes after register allocation but before prolog-epilog insertion. This should return true if -print-machineinstrs should print after these passes.

Reimplemented in llvm::X86TargetMachine.

Definition at line 302 of file TargetMachine.h.

Referenced by addCommonCodeGenPasses().

virtual bool llvm::LLVMTargetMachine::addPreEmitPass ( PassManagerBase &  ,
bool   
) [inline, virtual]

addPreEmitPass - This pass may be implemented by targets that want to run passes immediately before machine code is emitted. This should return true if -print-machineinstrs should print out the code after the passes.

Reimplemented in llvm::AlphaTargetMachine, llvm::ARMTargetMachine, llvm::IA64TargetMachine, llvm::MipsTargetMachine, llvm::PPCTargetMachine, and llvm::SparcTargetMachine.

Definition at line 309 of file TargetMachine.h.

Referenced by addPassesToEmitFile(), and addPassesToEmitMachineCode().

virtual bool llvm::LLVMTargetMachine::addAssemblyEmitter ( PassManagerBase &  ,
bool  ,
raw_ostream &   
) [inline, virtual]

addAssemblyEmitter - This pass should be overridden by the target to add the asmprinter, if asm emission is supported. If this is not supported, 'true' should be returned.

Reimplemented in llvm::AlphaTargetMachine, llvm::ARMTargetMachine, llvm::SPUTargetMachine, llvm::IA64TargetMachine, llvm::MipsTargetMachine, llvm::PIC16TargetMachine, llvm::PPCTargetMachine, llvm::SparcTargetMachine, llvm::X86TargetMachine, and llvm::XCoreTargetMachine.

Definition at line 317 of file TargetMachine.h.

Referenced by addPassesToEmitFile().

virtual bool llvm::LLVMTargetMachine::addCodeEmitter ( PassManagerBase &  ,
bool  ,
bool  ,
MachineCodeEmitter &   
) [inline, virtual]

addCodeEmitter - This pass should be overridden by the target to add a code emitter, if supported. If this is not supported, 'true' should be returned. If DumpAsm is true, the generated assembly is printed to cerr.

Reimplemented in llvm::AlphaTargetMachine, llvm::ARMTargetMachine, llvm::PPCTargetMachine, and llvm::X86TargetMachine.

Definition at line 325 of file TargetMachine.h.

Referenced by addPassesToEmitMachineCode().

virtual bool llvm::LLVMTargetMachine::addSimpleCodeEmitter ( PassManagerBase &  ,
bool  ,
bool  ,
MachineCodeEmitter &   
) [inline, virtual]

addSimpleCodeEmitter - This pass should be overridden by the target to add a code emitter (without setting flags), if supported. If this is not supported, 'true' should be returned. If DumpAsm is true, the generated assembly is printed to cerr.

Reimplemented in llvm::AlphaTargetMachine, llvm::ARMTargetMachine, llvm::PPCTargetMachine, and llvm::X86TargetMachine.

Definition at line 334 of file TargetMachine.h.

Referenced by addPassesToEmitFileFinish().

virtual bool llvm::LLVMTargetMachine::getEnableTailMergeDefault (  )  const [inline, virtual]

getEnableTailMergeDefault - the default setting for -enable-tail-merge on this target. User flag overrides.

Reimplemented from llvm::TargetMachine.

Reimplemented in llvm::PPCTargetMachine.

Definition at line 341 of file TargetMachine.h.

Referenced by addCommonCodeGenPasses().


The documentation for this class was generated from the following files: