Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ bool AsmPrinter::doInitialization(Module &M) {
HasSplitStack = false;
HasNoSplitStack = false;
DbgInfoAvailable = !M.debug_compile_units().empty();
const Triple &Target = TM.getTargetTriple();

AddrLabelSymbols = nullptr;

Expand All @@ -500,7 +501,7 @@ bool AsmPrinter::doInitialization(Module &M) {
// after emitting the .file pseudo-op. This allows additional
// information (such as the embedded command line) to be associated
// with all sections in the object file rather than a single section.
if (!TM.getTargetTriple().isOSBinFormatXCOFF())
if (!Target.isOSBinFormatXCOFF())
OutStreamer->initSections(false, *TM.getMCSubtargetInfo());

// Emit the version-min deployment target directive if needed.
Expand All @@ -511,7 +512,6 @@ bool AsmPrinter::doInitialization(Module &M) {
// alternative is duplicated code in each of the target asm printers that
// use the directive, where it would need the same conditionalization
// anyway.
const Triple &Target = TM.getTargetTriple();
if (Target.isOSBinFormatMachO() && Target.isOSDarwin()) {
Triple TVT(M.getDarwinTargetVariantTriple());
OutStreamer->emitVersionForTarget(
Expand Down Expand Up @@ -547,7 +547,7 @@ bool AsmPrinter::doInitialization(Module &M) {

// On AIX, emit bytes for llvm.commandline metadata after .file so that the
// C_INFO symbol is preserved if any csect is kept by the linker.
if (TM.getTargetTriple().isOSBinFormatXCOFF()) {
if (Target.isOSBinFormatXCOFF()) {
emitModuleCommandLines(M);
// Now we can generate section information.
OutStreamer->switchSection(
Expand Down Expand Up @@ -586,9 +586,8 @@ bool AsmPrinter::doInitialization(Module &M) {
bool EmitCodeView = M.getCodeViewFlag();
// On Windows targets, emit minimal CodeView compiler info even when debug
// info is disabled.
if ((TM.getTargetTriple().isOSWindows() &&
M.getNamedMetadata("llvm.dbg.cu")) ||
(TM.getTargetTriple().isUEFI() && EmitCodeView))
if ((Target.isOSWindows() && M.getNamedMetadata("llvm.dbg.cu")) ||
(Target.isUEFI() && EmitCodeView))
Handlers.push_back(std::make_unique<CodeViewDebug>(this));
if (!EmitCodeView || M.getDwarfVersion()) {
if (hasDebugInfo()) {
Expand Down Expand Up @@ -2681,6 +2680,7 @@ bool AsmPrinter::doFinalization(Module &M) {
// accesses to MF specific features at the module level and so that
// we can conditionalize accesses based on whether or not it is nullptr.
MF = nullptr;
const Triple &Target = TM.getTargetTriple();

std::vector<GlobalVariable *> GlobalsToTag;
for (GlobalVariable &G : M.globals()) {
Expand Down Expand Up @@ -2720,7 +2720,7 @@ bool AsmPrinter::doFinalization(Module &M) {
MCSymbol *Name = getSymbol(&F);
// Function getSymbol gives us the function descriptor symbol for XCOFF.

if (!TM.getTargetTriple().isOSBinFormatXCOFF()) {
if (!Target.isOSBinFormatXCOFF()) {
GlobalValue::VisibilityTypes V = F.getVisibility();
if (V == GlobalValue::DefaultVisibility)
continue;
Expand Down Expand Up @@ -2753,7 +2753,7 @@ bool AsmPrinter::doFinalization(Module &M) {

TLOF.emitModuleMetadata(*OutStreamer, M);

if (TM.getTargetTriple().isOSBinFormatELF()) {
if (Target.isOSBinFormatELF()) {
MachineModuleInfoELF &MMIELF = MMI->getObjFileInfo<MachineModuleInfoELF>();

// Output stubs for external and common global variables.
Expand All @@ -2771,7 +2771,7 @@ bool AsmPrinter::doFinalization(Module &M) {
}
}

if (TM.getTargetTriple().isOSBinFormatCOFF()) {
if (Target.isOSBinFormatCOFF()) {
MachineModuleInfoCOFF &MMICOFF =
MMI->getObjFileInfo<MachineModuleInfoCOFF>();

Expand Down Expand Up @@ -2884,7 +2884,7 @@ bool AsmPrinter::doFinalization(Module &M) {

// Emit bytes for llvm.commandline metadata.
// The command line metadata is emitted earlier on XCOFF.
if (!TM.getTargetTriple().isOSBinFormatXCOFF())
if (!Target.isOSBinFormatXCOFF())
emitModuleCommandLines(M);

// Emit .note.GNU-split-stack and .note.GNU-no-split-stack sections if
Expand Down Expand Up @@ -2919,7 +2919,7 @@ bool AsmPrinter::doFinalization(Module &M) {
}

// Emit symbol partition specifications (ELF only).
if (TM.getTargetTriple().isOSBinFormatELF()) {
if (Target.isOSBinFormatELF()) {
unsigned UniqueID = 0;
for (const GlobalValue &GV : M.global_values()) {
if (!GV.hasPartition() || GV.isDeclarationForLinker() ||
Expand Down