1 //===-- 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" 15 #include "llvm/ADT/Triple.h" 16 17 using namespace llvm; 18 anchor()19void NVPTXMCAsmInfo::anchor() {} 20 NVPTXMCAsmInfo(const Triple & TheTriple)21NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) { 22 if (TheTriple.getArch() == Triple::nvptx64) { 23 CodePointerSize = CalleeSaveStackSlotSize = 8; 24 } 25 26 CommentString = "//"; 27 28 HasSingleParameterDotFile = false; 29 30 InlineAsmStart = " begin inline asm"; 31 InlineAsmEnd = " end inline asm"; 32 33 SupportsDebugInformation = true; 34 // PTX does not allow .align on functions. 35 HasFunctionAlignment = false; 36 HasDotTypeDotSizeDirective = false; 37 // PTX does not allow .hidden or .protected 38 HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid; 39 ProtectedVisibilityAttr = MCSA_Invalid; 40 41 // 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; 51 52 // @TODO: Can we just disable this? 53 WeakDirective = "\t// .weak\t"; 54 GlobalDirective = "\t// .globl\t"; 55 } 56