1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/MC/MCAsmInfoXCOFF.cpp
Hubert Tong 3fcc50f75d [MC][Target][XCOFF] Consolidate MCAsmInfo XCOFF defaults; NFC
The setting of `MCAsmInfo` properties for XCOFF got split between
`MCAsmInfoXCOFF` and `PPCXCOFFMCAsmInfo`. Except for the properties that
are dependent on the target information being passed via the
constructor, the properties being set in `PPCXCOFFMCAsmInfo` had no
fundamental reason for being treated as specific for XCOFF on PowerPC.
Indeed, the property that might be considered more specific to PowerPC,
`NeedsFunctionDescriptors`, was set in `MCAsmInfoXCOFF`.

XCOFF being specific to PowerPC anyway, this patch consolidates the
setting of the properties into `MCAsmInfoXCOFF` except for the cases
that are dependent on the information provided via the
`PPCXCOFFMCAsmInfo` constructor.

This patch also reorders the assignments to the fields to match the
declaration order in `MCAsmInfo`.
2020-04-30 20:48:30 -04:00

42 lines
1.3 KiB
C++

//===- MC/MCAsmInfoXCOFF.cpp - XCOFF asm properties ------------ *- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCAsmInfoXCOFF.h"
using namespace llvm;
void MCAsmInfoXCOFF::anchor() {}
MCAsmInfoXCOFF::MCAsmInfoXCOFF() {
IsLittleEndian = false;
SupportsQuotedNames = false;
UseDotAlignForAlignment = true;
ZeroDirective = "\t.space\t";
ZeroDirectiveSupportsNonZeroValue = false;
AsciiDirective = nullptr; // not supported
AscizDirective = nullptr; // not supported
Data64bitsDirective = "\t.llong\t";
COMMDirectiveAlignmentIsInBytes = false;
LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
HasDotTypeDotSizeDirective = false;
HasDotExternDirective = true;
HasDotLGloblDirective = true;
SymbolsHaveSMC = true;
UseIntegratedAssembler = false;
NeedsFunctionDescriptors = true;
}
bool MCAsmInfoXCOFF::isAcceptableChar(char C) const {
// QualName is allowed for a MCSymbolXCOFF, and
// QualName contains '[' and ']'.
if (C == '[' || C == ']')
return true;
return MCAsmInfo::isAcceptableChar(C);
}