blob: f6cbd23f01c400b91b88132e744e74b7277a48b9 [file] [log] [blame]
Justin Holewinskiae556d32012-05-04 20:18:50 +00001//===-- NVPTXMCAsmInfo.cpp - NVPTX 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 contains the declarations of the NVPTXMCAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "NVPTXMCAsmInfo.h"
Daniel Sanders50f17232015-09-15 16:17:27 +000015#include "llvm/ADT/Triple.h"
Justin Holewinskiae556d32012-05-04 20:18:50 +000016
17using namespace llvm;
18
Justin Holewinski0497ab12013-03-30 14:29:21 +000019void NVPTXMCAsmInfo::anchor() {}
Justin Holewinskiae556d32012-05-04 20:18:50 +000020
Daniel Sanders50f17232015-09-15 16:17:27 +000021NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) {
22 if (TheTriple.getArch() == Triple::nvptx64) {
Konstantin Zhuravlyovdc77b2e2017-04-17 17:41:25 +000023 CodePointerSize = CalleeSaveStackSlotSize = 8;
Eli Bendersky32aab222013-01-23 16:22:04 +000024 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000025
26 CommentString = "//";
27
Justin Holewinskiae556d32012-05-04 20:18:50 +000028 HasSingleParameterDotFile = false;
29
Justin Lebar87a174c2016-05-10 00:31:22 +000030 InlineAsmStart = " begin inline asm";
31 InlineAsmEnd = " end inline asm";
Justin Holewinskiae556d32012-05-04 20:18:50 +000032
Eric Christopher68f22182018-05-18 03:13:08 +000033 SupportsDebugInformation = true;
Jingyue Wue8290f22015-03-12 01:50:30 +000034 // PTX does not allow .align on functions.
35 HasFunctionAlignment = false;
Justin Holewinskiae556d32012-05-04 20:18:50 +000036 HasDotTypeDotSizeDirective = false;
Artem Belevich5be0706e2016-01-15 23:57:53 +000037 // PTX does not allow .hidden or .protected
38 HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
39 ProtectedVisibilityAttr = MCSA_Invalid;
Justin Holewinskiae556d32012-05-04 20:18:50 +000040
Eric Christopher68f22182018-05-18 03:13:08 +000041 // FIXME: remove comment once debug info is properly supported.
42 Data8bitsDirective = "// .b8 ";
43 Data16bitsDirective = nullptr; // not supported
44 Data32bitsDirective = "// .b32 ";
45 Data64bitsDirective = "// .b64 ";
46 ZeroDirective = "// .b8";
47 AsciiDirective = nullptr; // not supported
48 AscizDirective = nullptr; // not supported
49 SupportsQuotedNames = false;
50 SupportsExtendedDwarfLocDirective = false;
Justin Holewinskiae556d32012-05-04 20:18:50 +000051
52 // @TODO: Can we just disable this?
Jingyue Wu5b62eb92014-12-01 21:16:17 +000053 WeakDirective = "\t// .weak\t";
Justin Holewinskiae556d32012-05-04 20:18:50 +000054 GlobalDirective = "\t// .globl\t";
55}