Path: blob/main/contrib/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp
35233 views
//===- MCAsmInfoCOFF.cpp - COFF asm properties ----------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file defines target asm properties related what form asm statements9// should take in general on COFF-based targets10//11//===----------------------------------------------------------------------===//1213#include "llvm/MC/MCAsmInfoCOFF.h"14#include "llvm/MC/MCDirectives.h"1516using namespace llvm;1718void MCAsmInfoCOFF::anchor() {}1920MCAsmInfoCOFF::MCAsmInfoCOFF() {21// MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte22// alignment.23COMMDirectiveAlignmentIsInBytes = false;24LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;25HasDotTypeDotSizeDirective = false;26HasSingleParameterDotFile = true;27WeakRefDirective = "\t.weak\t";28AvoidWeakIfComdat = true;2930// Doesn't support visibility:31HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid;32ProtectedVisibilityAttr = MCSA_Invalid;3334// Set up DWARF directives35SupportsDebugInformation = true;36NeedsDwarfSectionOffsetDirective = true;3738// At least MSVC inline-asm does AShr.39UseLogicalShr = false;4041// If this is a COFF target, assume that it supports associative comdats. It's42// part of the spec.43HasCOFFAssociativeComdats = true;4445// We can generate constants in comdat sections that can be shared,46// but in order not to create null typed symbols, we actually need to47// make them global symbols as well.48HasCOFFComdatConstants = true;49}5051void MCAsmInfoMicrosoft::anchor() {}5253MCAsmInfoMicrosoft::MCAsmInfoMicrosoft() = default;5455void MCAsmInfoGNUCOFF::anchor() {}5657MCAsmInfoGNUCOFF::MCAsmInfoGNUCOFF() {58// If this is a GNU environment (mingw or cygwin), don't use associative59// comdats for jump tables, unwind information, and other data associated with60// a function.61HasCOFFAssociativeComdats = false;6263// We don't create constants in comdat sections for MinGW.64HasCOFFComdatConstants = false;65}666768