63 lines · cpp
1//===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains the declarations of the NVPTXMCAsmInfo properties.10//11//===----------------------------------------------------------------------===//12 13#include "NVPTXMCAsmInfo.h"14#include "llvm/TargetParser/Triple.h"15 16using namespace llvm;17 18NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple,19 const MCTargetOptions &Options) {20 if (TheTriple.getArch() == Triple::nvptx64) {21 CodePointerSize = CalleeSaveStackSlotSize = 8;22 }23 24 CommentString = "//";25 26 HasSingleParameterDotFile = false;27 28 InlineAsmStart = " begin inline asm";29 InlineAsmEnd = " end inline asm";30 31 SupportsDebugInformation = true;32 // PTX does not allow .align on functions.33 HasFunctionAlignment = false;34 HasDotTypeDotSizeDirective = false;35 // PTX does not allow .hidden or .protected36 HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;37 ProtectedVisibilityAttr = MCSA_Invalid;38 39 Data8bitsDirective = ".b8 ";40 Data16bitsDirective = nullptr; // not supported41 Data32bitsDirective = ".b32 ";42 Data64bitsDirective = ".b64 ";43 ZeroDirective = ".b8";44 AsciiDirective = nullptr; // not supported45 AscizDirective = nullptr; // not supported46 SupportsQuotedNames = false;47 SupportsExtendedDwarfLocDirective = false;48 SupportsSignedData = false;49 50 PrivateGlobalPrefix = "$L__";51 PrivateLabelPrefix = PrivateGlobalPrefix;52 53 // @TODO: Can we just disable this?54 WeakDirective = "\t// .weak\t";55 GlobalDirective = "\t// .globl\t";56 57 UseIntegratedAssembler = false;58 59 // ptxas does not support DWARF `.file fileno directory filename'60 // syntax as of v11.X.61 EnableDwarfFileDirectoryDefault = false;62}63