LLVM API Documentation
#include "llvm/CodeGen/AsmPrinter.h"
#include "DwarfDebug.h"
#include "DwarfException.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/GCMetadataPrinter.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/DebugInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Timer.h"
#include "llvm/Target/Mangler.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Transforms/Utils/GlobalStatus.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "asm-printer" |
Typedefs | |
typedef DenseMap< GCStrategy *, GCMetadataPrinter * > | gcp_map_type |
Variables | |
static const char *const | DWARFGroupName = "DWARF Emission" |
static const char *const | DbgTimerName = "DWARF Debug Writer" |
static const char *const | EHTimerName = "DWARF Exception Writer" |
#define DEBUG_TYPE "asm-printer" |
Definition at line 14 of file AsmPrinter.cpp.
typedef DenseMap<GCStrategy*,GCMetadataPrinter*> gcp_map_type |
Definition at line 62 of file AsmPrinter.cpp.
|
static |
emitBasicBlockLoopComments - Pretty-print comments for basic blocks.
Definition at line 2087 of file AsmPrinter.cpp.
References llvm::MCStreamer::AddComment(), llvm::LoopBase< N, M >::empty(), llvm::MCStreamer::GetCommentOS(), llvm::AsmPrinter::getFunctionNumber(), llvm::LoopBase< N, M >::getHeader(), llvm::LoopBase< N, M >::getLoopDepth(), llvm::MachineLoopInfo::getLoopFor(), llvm::LoopBase< N, M >::getParentLoop(), llvm::raw_ostream::indent(), llvm::AsmPrinter::OutStreamer, PrintChildLoopComment(), and PrintParentLoopComment().
Referenced by llvm::AsmPrinter::EmitBasicBlockStart().
|
static |
emitComments - Pretty-print comments for instructions.
Definition at line 512 of file AsmPrinter.cpp.
References llvm::MachineInstr::getAsmPrinterFlag(), llvm::MachineFunction::getFrameInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::getParent(), llvm::MachineMemOperand::getSize(), llvm::MachineFunction::getTarget(), llvm::TargetInstrInfo::hasLoadFromStackSlot(), llvm::TargetInstrInfo::hasStoreToStackSlot(), llvm::TargetInstrInfo::isLoadFromStackSlotPostFE(), llvm::MachineFrameInfo::isSpillSlotObjectIndex(), llvm::TargetInstrInfo::isStoreToStackSlotPostFE(), llvm::MachineInstr::memoperands_begin(), llvm::MachineInstr::ReloadReuse, and llvm::SystemZISD::TM.
Referenced by llvm::AsmPrinter::EmitFunctionBody().
|
static |
emitDebugValueComment - This method handles the target-independent form of DBG_VALUE, returning true if it was able to do so. A false return means the target will need to handle MI in EmitInstruction.
Definition at line 572 of file AsmPrinter.cpp.
References llvm::lltok::APFloat, llvm::APFloat::convert(), llvm::APFloat::convertToDouble(), llvm::APFloat::convertToFloat(), llvm::MCStreamer::EmitRawText(), llvm::StringRef::empty(), llvm::MachineOperand::getCImm(), llvm::MCAsmInfo::getCommentString(), llvm::DIVariable::getContext(), llvm::MachineOperand::getFPImm(), llvm::TargetFrameLowering::getFrameIndexReference(), llvm::TargetMachine::getFrameLowering(), llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineOperand::getMetadata(), llvm::MCRegisterInfo::getName(), llvm::DIVariable::getName(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::ConstantFP::getValueAPF(), llvm::APFloat::IEEEdouble, llvm::MachineOperand::isCImm(), llvm::Type::isDoubleTy(), llvm::MachineOperand::isFI(), llvm::Type::isFloatTy(), llvm::MachineOperand::isFPImm(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), llvm::DIDescriptor::isSubprogram(), llvm::AsmPrinter::MAI, llvm::AsmPrinter::MF, llvm::AsmPrinter::OutStreamer, llvm::APInt::print(), llvm::APFloat::rmNearestTiesToEven, llvm::raw_svector_ostream::str(), and llvm::AsmPrinter::TM.
Referenced by llvm::AsmPrinter::EmitFunctionBody().
|
static |
Definition at line 1748 of file AsmPrinter.cpp.
References llvm::MCStreamer::EmitFill(), emitGlobalConstantImpl(), llvm::TargetMachine::getDataLayout(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::ConstantArray::getType(), llvm::DataLayout::getTypeAllocSize(), isRepeatedByteSequence(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by emitGlobalConstantImpl().
|
static |
Definition at line 1683 of file AsmPrinter.cpp.
References llvm::MCStreamer::EmitBytes(), llvm::MCStreamer::EmitFill(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitZeros(), F(), llvm::format(), llvm::ConstantDataSequential::getAsString(), llvm::MCStreamer::GetCommentOS(), llvm::TargetMachine::getDataLayout(), llvm::ConstantDataSequential::getElementAsDouble(), llvm::ConstantDataSequential::getElementAsFloat(), llvm::ConstantDataSequential::getElementAsInteger(), llvm::ConstantDataSequential::getElementByteSize(), llvm::SequentialType::getElementType(), llvm::ConstantDataSequential::getElementType(), llvm::ConstantDataSequential::getNumElements(), llvm::ConstantDataSequential::getType(), llvm::DataLayout::getTypeAllocSize(), I, llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), isRepeatedByteSequence(), llvm::ConstantDataSequential::isString(), llvm::AsmPrinter::isVerbose(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by emitGlobalConstantImpl().
|
static |
Definition at line 1802 of file AsmPrinter.cpp.
References llvm::APFloat::bitcastToAPInt(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitZeros(), llvm::APInt::getBitWidth(), llvm::MCStreamer::GetCommentOS(), llvm::TargetMachine::getDataLayout(), llvm::APInt::getNumWords(), llvm::APInt::getRawData(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::DataLayout::getTypeStoreSize(), llvm::ConstantFP::getValueAPF(), llvm::DataLayout::isBigEndian(), llvm::Type::isPPC_FP128Ty(), llvm::AsmPrinter::isVerbose(), llvm::AsmPrinter::OutStreamer, llvm::Type::print(), llvm::tgtok::StrVal, llvm::AsmPrinter::TM, and llvm::APFloat::toString().
Referenced by emitGlobalConstantImpl().
|
static |
Definition at line 1903 of file AsmPrinter.cpp.
References llvm::ConstantFoldConstantExpression(), emitGlobalConstantArray(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantLargeInt(), emitGlobalConstantStruct(), emitGlobalConstantVector(), llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitValue(), llvm::MCStreamer::EmitZeros(), llvm::format(), llvm::MCStreamer::GetCommentOS(), llvm::TargetMachine::getDataLayout(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::AsmPrinter::isVerbose(), lowerConstant(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by llvm::AsmPrinter::EmitGlobalConstant(), emitGlobalConstantArray(), emitGlobalConstantStruct(), and emitGlobalConstantVector().
|
static |
Definition at line 1847 of file AsmPrinter.cpp.
References llvm::MCStreamer::EmitIntValue(), llvm::ConstantInt::getBitWidth(), llvm::TargetMachine::getDataLayout(), llvm::ConstantInt::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getValue(), llvm::DataLayout::isBigEndian(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by emitGlobalConstantImpl().
|
static |
Definition at line 1775 of file AsmPrinter.cpp.
References emitGlobalConstantImpl(), llvm::MCStreamer::EmitZeros(), llvm::tgtok::Field, llvm::TargetMachine::getDataLayout(), llvm::StructLayout::getElementOffset(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::StructLayout::getSizeInBytes(), llvm::DataLayout::getStructLayout(), llvm::Value::getType(), llvm::ConstantStruct::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by emitGlobalConstantImpl().
|
static |
Definition at line 1763 of file AsmPrinter.cpp.
References emitGlobalConstantImpl(), llvm::MCStreamer::EmitZeros(), llvm::TargetMachine::getDataLayout(), llvm::SequentialType::getElementType(), llvm::VectorType::getNumElements(), llvm::User::getOperand(), llvm::ConstantVector::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by emitGlobalConstantImpl().
|
static |
Definition at line 556 of file AsmPrinter.cpp.
References llvm::MCStreamer::AddBlankLine(), llvm::MCStreamer::AddComment(), llvm::MCRegisterInfo::getName(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), llvm::AsmPrinter::OutStreamer, and llvm::AsmPrinter::TM.
Referenced by llvm::AsmPrinter::EmitFunctionBody().
|
static |
Definition at line 63 of file AsmPrinter.cpp.
Referenced by llvm::AsmPrinter::~AsmPrinter().
|
static |
getGVAlignmentLog2 - Return the alignment to use for the specified global value in log2 form. This rounds up to the preferred alignment if possible and legal.
Definition at line 73 of file AsmPrinter.cpp.
References llvm::GlobalValue::getAlignment(), llvm::DataLayout::getPreferredAlignmentLog(), llvm::GlobalValue::hasSection(), and llvm::Log2_32().
Referenced by llvm::AsmPrinter::EmitAlignment(), and llvm::AsmPrinter::EmitGlobalVariable().
|
static |
isRepeatedByteSequence - Determine whether the given value is composed of a repeated sequence of identical bytes and return the byte value. If it is not a repeated sequence, return -1.
Definition at line 1627 of file AsmPrinter.cpp.
References llvm::CallingConv::C, llvm::StringRef::empty(), llvm::ConstantDataSequential::getRawDataValues(), and llvm::StringRef::size().
Referenced by emitGlobalConstantArray(), emitGlobalConstantDataSequential(), and isRepeatedByteSequence().
|
static |
isRepeatedByteSequence - Determine whether the given value is composed of a repeated sequence of identical bytes and return the byte value. If it is not a repeated sequence, return -1.
Definition at line 1640 of file AsmPrinter.cpp.
References llvm::TargetMachine::getDataLayout(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::isPowerOf2_64(), isRepeatedByteSequence(), and llvm::SystemZISD::TM.
|
static |
lowerConstant - Lower the specified LLVM Constant to an MCExpr.
Definition at line 1498 of file AsmPrinter.cpp.
References llvm::APIntOps::And(), llvm::CallingConv::C, llvm::ConstantFoldConstantExpression(), llvm::MCConstantExpr::Create(), llvm::MCSymbolRefExpr::Create(), llvm::MCBinaryExpr::CreateAdd(), llvm::MCBinaryExpr::CreateAnd(), llvm::MCBinaryExpr::CreateDiv(), llvm::MCBinaryExpr::CreateMod(), llvm::MCBinaryExpr::CreateMul(), llvm::MCBinaryExpr::CreateOr(), llvm::MCBinaryExpr::CreateShl(), llvm::MCBinaryExpr::CreateSub(), llvm::MCBinaryExpr::CreateXor(), llvm::dyn_cast(), llvm::AsmPrinter::GetBlockAddressSymbol(), llvm::TargetMachine::getDataLayout(), llvm::MachineFunction::getFunction(), llvm::ConstantExpr::getIntegerCast(), llvm::DataLayout::getIntPtrType(), llvm::ConstantExpr::getOpcode(), llvm::User::getOperand(), llvm::GlobalValue::getParent(), llvm::DataLayout::getPointerTypeSizeInBits(), llvm::APInt::getSExtValue(), llvm::AsmPrinter::getSymbol(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::DataLayout::getTypeAllocSizeInBits(), llvm::Constant::isNullValue(), llvm_unreachable, llvm::AsmPrinter::MF, llvm::APIntOps::Or(), llvm::AsmPrinter::OutContext, llvm::report_fatal_error(), llvm::raw_string_ostream::str(), llvm::AsmPrinter::TM, llvm::WriteAsOperand(), and llvm::APIntOps::Xor().
Referenced by emitGlobalConstantImpl().
|
static |
PrintChildLoopComment - Print comments about child loops within the loop for this basic block, with nesting.
Definition at line 2074 of file AsmPrinter.cpp.
References llvm::LoopBase< N, M >::begin(), llvm::LoopBase< N, M >::end(), and llvm::raw_ostream::indent().
Referenced by emitBasicBlockLoopComments().
|
static |
PrintParentLoopComment - Print comments about parent loops of this one.
Definition at line 2061 of file AsmPrinter.cpp.
References FunctionNumber(), llvm::LoopBase< N, M >::getHeader(), llvm::LoopBase< N, M >::getLoopDepth(), llvm::LoopBase< N, M >::getParentLoop(), and llvm::raw_ostream::indent().
Referenced by emitBasicBlockLoopComments().
STATISTIC | ( | EmittedInsts | , |
"Number of machine instrs printed" | |||
) |
|
static |
Definition at line 55 of file AsmPrinter.cpp.
Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::EmitFunctionBody(), and llvm::AsmPrinter::EmitFunctionHeader().
|
static |
Definition at line 54 of file AsmPrinter.cpp.
Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::EmitFunctionBody(), and llvm::AsmPrinter::EmitFunctionHeader().
|
static |
Definition at line 56 of file AsmPrinter.cpp.
Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::EmitFunctionBody(), and llvm::AsmPrinter::EmitFunctionHeader().