blob: 15886eb619b9068d5db064600e40d20bf65751ec [file] [log] [blame]
Eugene Zelenkoa700a602017-02-11 00:27:28 +00001//===- MCAsmInfoCOFF.cpp - COFF asm properties ----------------------------===//
Chris Lattner40412e72009-07-27 16:45:59 +00002//
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
Chris Lattneraf76e592009-08-22 20:48:53 +000015#include "llvm/MC/MCAsmInfoCOFF.h"
Eugene Zelenkoa700a602017-02-11 00:27:28 +000016#include "llvm/MC/MCDirectives.h"
17
Chris Lattner40412e72009-07-27 16:45:59 +000018using namespace llvm;
19
Eugene Zelenkoa700a602017-02-11 00:27:28 +000020void MCAsmInfoCOFF::anchor() {}
David Blaikie2d24e2a2011-12-20 02:50:00 +000021
Chris Lattner8eeba352010-01-20 06:34:14 +000022MCAsmInfoCOFF::MCAsmInfoCOFF() {
Benjamin Kramera9e37c52012-09-07 21:08:01 +000023 // MingW 4.5 and later support .comm with log2 alignment, but .lcomm uses byte
24 // alignment.
25 COMMDirectiveAlignmentIsInBytes = false;
26 LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
Chris Lattner40412e72009-07-27 16:45:59 +000027 HasDotTypeDotSizeDirective = false;
Reid Klecknerfe471b02018-12-21 23:35:48 +000028 HasSingleParameterDotFile = true;
Chris Lattner40412e72009-07-27 16:45:59 +000029 WeakRefDirective = "\t.weak\t";
Rafael Espindola29a0d2a2013-12-02 23:04:51 +000030 HasLinkOnceDirective = true;
Jim Grosbach2684d9e2012-05-11 01:41:30 +000031
Chris Lattner152a29b2010-01-23 06:53:23 +000032 // Doesn't support visibility:
Eli Friedman7666c7e2011-09-23 00:13:02 +000033 HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid;
34 ProtectedVisibilityAttr = MCSA_Invalid;
Chris Lattner40412e72009-07-27 16:45:59 +000035
36 // Set up DWARF directives
Chris Lattner40412e72009-07-27 16:45:59 +000037 SupportsDebugInformation = true;
Matt Arsenault9a0e12a2013-04-22 22:49:11 +000038 NeedsDwarfSectionOffsetDirective = true;
Daniel Sanders38c6b582014-02-13 14:44:26 +000039
40 UseIntegratedAssembler = true;
Ahmed Bougachae1f835a2015-04-28 01:37:11 +000041
Ahmed Bougacha5d2b5c72015-11-11 00:51:36 +000042 // At least MSVC inline-asm does AShr.
Ahmed Bougachae1f835a2015-04-28 01:37:11 +000043 UseLogicalShr = false;
Reid Kleckner845b4392018-06-21 20:27:38 +000044
45 // If this is a COFF target, assume that it supports associative comdats. It's
46 // part of the spec.
47 HasCOFFAssociativeComdats = true;
Martin Storsjo078cc9c2018-07-26 10:48:20 +000048
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;
Chris Lattner40412e72009-07-27 16:45:59 +000053}
Michael J. Spencer116bc792011-11-29 18:00:06 +000054
Eugene Zelenkoa700a602017-02-11 00:27:28 +000055void MCAsmInfoMicrosoft::anchor() {}
David Blaikie2d24e2a2011-12-20 02:50:00 +000056
Eugene Zelenkoa700a602017-02-11 00:27:28 +000057MCAsmInfoMicrosoft::MCAsmInfoMicrosoft() = default;
Michael J. Spencer116bc792011-11-29 18:00:06 +000058
Eugene Zelenkoa700a602017-02-11 00:27:28 +000059void MCAsmInfoGNUCOFF::anchor() {}
David Blaikie2d24e2a2011-12-20 02:50:00 +000060
Reid Kleckner845b4392018-06-21 20:27:38 +000061MCAsmInfoGNUCOFF::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 HasCOFFAssociativeComdats = false;
Martin Storsjo078cc9c2018-07-26 10:48:20 +000066
67 // We don't create constants in comdat sections for MinGW.
68 HasCOFFComdatConstants = false;
Reid Kleckner845b4392018-06-21 20:27:38 +000069}