1 //===- MCAsmInfoCOFF.cpp - COFF asm properties ----------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines target asm properties related what form asm statements
11 // should take in general on COFF-based targets
13 //===----------------------------------------------------------------------===//
15 #include "llvm/MC/MCAsmInfoCOFF.h"
16 #include "llvm/MC/MCDirectives.h"
20 void MCAsmInfoCOFF::anchor() {}
22 MCAsmInfoCOFF::MCAsmInfoCOFF() {
23 // MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte
25 COMMDirectiveAlignmentIsInBytes = false;
26 LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
27 HasDotTypeDotSizeDirective = false;
28 HasSingleParameterDotFile = true;
29 WeakRefDirective = "\t.weak\t";
30 HasLinkOnceDirective = true;
32 // Doesn't support visibility:
33 HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid;
34 ProtectedVisibilityAttr = MCSA_Invalid;
36 // Set up DWARF directives
37 SupportsDebugInformation = true;
38 NeedsDwarfSectionOffsetDirective = true;
40 UseIntegratedAssembler = true;
42 // At least MSVC inline-asm does AShr.
43 UseLogicalShr = false;
45 // If this is a COFF target, assume that it supports associative comdats. It's
47 HasCOFFAssociativeComdats = true;
49 // We can generate constants in comdat sections that can be shared,
50 // but in order not to create null typed symbols, we actually need to
51 // make them global symbols as well.
52 HasCOFFComdatConstants = true;
55 void MCAsmInfoMicrosoft::anchor() {}
57 MCAsmInfoMicrosoft::MCAsmInfoMicrosoft() = default;
59 void MCAsmInfoGNUCOFF::anchor() {}
61 MCAsmInfoGNUCOFF::MCAsmInfoGNUCOFF() {
62 // If this is a GNU environment (mingw or cygwin), don't use associative
63 // comdats for jump tables, unwind information, and other data associated with
65 HasCOFFAssociativeComdats = false;
67 // We don't create constants in comdat sections for MinGW.
68 HasCOFFComdatConstants = false;