2012-05-05 04:18:50 +08:00
|
|
|
//===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the declarations of the NVPTXMCAsmInfo properties.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "NVPTXMCAsmInfo.h"
|
2015-09-16 00:17:27 +08:00
|
|
|
#include "llvm/ADT/Triple.h"
|
2012-05-05 04:18:50 +08:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
// -debug-compile - Command line option to inform opt and llc passes to
|
|
|
|
// compile for debugging
|
2013-05-24 00:09:15 +08:00
|
|
|
static cl::opt<bool> CompileForDebugging("debug-compile",
|
|
|
|
cl::desc("Compile for debugging"),
|
|
|
|
cl::Hidden, cl::init(false));
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2013-03-30 22:29:21 +08:00
|
|
|
void NVPTXMCAsmInfo::anchor() {}
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2015-09-16 00:17:27 +08:00
|
|
|
NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) {
|
|
|
|
if (TheTriple.getArch() == Triple::nvptx64) {
|
2013-01-24 00:22:04 +08:00
|
|
|
PointerSize = CalleeSaveStackSlotSize = 8;
|
|
|
|
}
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
CommentString = "//";
|
|
|
|
|
|
|
|
HasSingleParameterDotFile = false;
|
|
|
|
|
2016-05-10 08:31:22 +08:00
|
|
|
InlineAsmStart = " begin inline asm";
|
|
|
|
InlineAsmEnd = " end inline asm";
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
SupportsDebugInformation = CompileForDebugging;
|
2015-03-12 09:50:30 +08:00
|
|
|
// PTX does not allow .align on functions.
|
|
|
|
HasFunctionAlignment = false;
|
2012-05-05 04:18:50 +08:00
|
|
|
HasDotTypeDotSizeDirective = false;
|
2016-01-16 07:57:53 +08:00
|
|
|
// PTX does not allow .hidden or .protected
|
|
|
|
HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
|
|
|
|
ProtectedVisibilityAttr = MCSA_Invalid;
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
Data8bitsDirective = " .b8 ";
|
|
|
|
Data16bitsDirective = " .b16 ";
|
|
|
|
Data32bitsDirective = " .b32 ";
|
|
|
|
Data64bitsDirective = " .b64 ";
|
2013-03-30 22:29:21 +08:00
|
|
|
ZeroDirective = " .b8";
|
2012-05-05 04:18:50 +08:00
|
|
|
AsciiDirective = " .b8";
|
|
|
|
AscizDirective = " .b8";
|
|
|
|
|
|
|
|
// @TODO: Can we just disable this?
|
2014-12-02 05:16:17 +08:00
|
|
|
WeakDirective = "\t// .weak\t";
|
2012-05-05 04:18:50 +08:00
|
|
|
GlobalDirective = "\t// .globl\t";
|
|
|
|
}
|