Line data Source code
1 : //===- MCAsmInfoCOFF.cpp - COFF asm properties ----------------------------===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 : //
10 : // This file defines target asm properties related what form asm statements
11 : // should take in general on COFF-based targets
12 : //
13 : //===----------------------------------------------------------------------===//
14 :
15 : #include "llvm/MC/MCAsmInfoCOFF.h"
16 : #include "llvm/MC/MCDirectives.h"
17 :
18 : using namespace llvm;
19 :
20 0 : void MCAsmInfoCOFF::anchor() {}
21 :
22 1857 : MCAsmInfoCOFF::MCAsmInfoCOFF() {
23 : // MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte
24 : // alignment.
25 1857 : COMMDirectiveAlignmentIsInBytes = false;
26 1857 : LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
27 1857 : HasDotTypeDotSizeDirective = false;
28 1857 : HasSingleParameterDotFile = false;
29 1857 : WeakRefDirective = "\t.weak\t";
30 1857 : HasLinkOnceDirective = true;
31 :
32 : // Doesn't support visibility:
33 1857 : HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid;
34 1857 : ProtectedVisibilityAttr = MCSA_Invalid;
35 :
36 : // Set up DWARF directives
37 1857 : SupportsDebugInformation = true;
38 1857 : NeedsDwarfSectionOffsetDirective = true;
39 :
40 1857 : UseIntegratedAssembler = true;
41 :
42 : // At least MSVC inline-asm does AShr.
43 1857 : UseLogicalShr = false;
44 :
45 : // If this is a COFF target, assume that it supports associative comdats. It's
46 : // part of the spec.
47 1857 : HasCOFFAssociativeComdats = true;
48 :
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 1857 : HasCOFFComdatConstants = true;
53 1857 : }
54 :
55 0 : void MCAsmInfoMicrosoft::anchor() {}
56 :
57 : MCAsmInfoMicrosoft::MCAsmInfoMicrosoft() = default;
58 :
59 0 : void MCAsmInfoGNUCOFF::anchor() {}
60 :
61 374 : 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
64 : // a function.
65 374 : HasCOFFAssociativeComdats = false;
66 :
67 : // We don't create constants in comdat sections for MinGW.
68 374 : HasCOFFComdatConstants = false;
69 374 : }
|