[clang] 5a646ed - [clang][CodeGen] Break up TargetInfo.cpp [2/8]
Sergei Barannikov via cfe-commits
cfe-commits at lists.llvm.org
Fri May 19 13:55:33 PDT 2023
Author: Sergei Barannikov
Date: 2023-05-19T23:55:02+03:00
New Revision: 5a646ed6835f2686cc0574047ce3c9bbaf323ea3
URL: https://github.com/llvm/llvm-project/commit/5a646ed6835f2686cc0574047ce3c9bbaf323ea3
DIFF: https://github.com/llvm/llvm-project/commit/5a646ed6835f2686cc0574047ce3c9bbaf323ea3.diff
LOG: [clang][CodeGen] Break up TargetInfo.cpp [2/8]
Move `ABIKind` enums out of `*ABIInfo` classes to break the dependency
between `getTargetCodeGenInfo` and the classes.
This will allow to move the classes to different cpp files.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D148090
Added:
Modified:
clang/lib/CodeGen/TargetInfo.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 5514161da230..078bd1087220 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -830,19 +830,18 @@ ABIArgInfo DefaultABIInfo::classifyReturnType(QualType RetTy) const {
// This is a very simple ABI that relies a lot on DefaultABIInfo.
//===----------------------------------------------------------------------===//
-class WebAssemblyABIInfo final : public ABIInfo {
-public:
- enum ABIKind {
- MVP = 0,
- ExperimentalMV = 1,
- };
+enum class WebAssemblyABIKind {
+ MVP = 0,
+ ExperimentalMV = 1,
+};
-private:
+class WebAssemblyABIInfo final : public ABIInfo {
DefaultABIInfo defaultInfo;
- ABIKind Kind;
+ WebAssemblyABIKind Kind;
public:
- explicit WebAssemblyABIInfo(CodeGen::CodeGenTypes &CGT, ABIKind Kind)
+ explicit WebAssemblyABIInfo(CodeGen::CodeGenTypes &CGT,
+ WebAssemblyABIKind Kind)
: ABIInfo(CGT), defaultInfo(CGT), Kind(Kind) {}
private:
@@ -866,7 +865,7 @@ class WebAssemblyABIInfo final : public ABIInfo {
class WebAssemblyTargetCodeGenInfo final : public TargetCodeGenInfo {
public:
explicit WebAssemblyTargetCodeGenInfo(CodeGen::CodeGenTypes &CGT,
- WebAssemblyABIInfo::ABIKind K)
+ WebAssemblyABIKind K)
: TargetCodeGenInfo(std::make_unique<WebAssemblyABIInfo>(CGT, K)) {
SwiftInfo =
std::make_unique<SwiftABIInfo>(CGT, /*SwiftErrorInRegister=*/false);
@@ -931,7 +930,7 @@ ABIArgInfo WebAssemblyABIInfo::classifyArgumentType(QualType Ty) const {
if (const Type *SeltTy = isSingleElementStruct(Ty, getContext()))
return ABIArgInfo::getDirect(CGT.ConvertType(QualType(SeltTy, 0)));
// For the experimental multivalue ABI, fully expand all other aggregates
- if (Kind == ABIKind::ExperimentalMV) {
+ if (Kind == WebAssemblyABIKind::ExperimentalMV) {
const RecordType *RT = Ty->getAs<RecordType>();
assert(RT);
bool HasBitField = false;
@@ -964,7 +963,7 @@ ABIArgInfo WebAssemblyABIInfo::classifyReturnType(QualType RetTy) const {
if (const Type *SeltTy = isSingleElementStruct(RetTy, getContext()))
return ABIArgInfo::getDirect(CGT.ConvertType(QualType(SeltTy, 0)));
// For the experimental multivalue ABI, return all other aggregates
- if (Kind == ABIKind::ExperimentalMV)
+ if (Kind == WebAssemblyABIKind::ExperimentalMV)
return ABIArgInfo::getDirect();
}
}
@@ -4973,21 +4972,19 @@ PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
// PowerPC-64
namespace {
+enum class PPC64_SVR4_ABIKind {
+ ELFv1 = 0,
+ ELFv2,
+};
+
/// PPC64_SVR4_ABIInfo - The 64-bit PowerPC ELF (SVR4) ABI information.
class PPC64_SVR4_ABIInfo : public ABIInfo {
-public:
- enum ABIKind {
- ELFv1 = 0,
- ELFv2
- };
-
-private:
static const unsigned GPRBits = 64;
- ABIKind Kind;
+ PPC64_SVR4_ABIKind Kind;
bool IsSoftFloatABI;
public:
- PPC64_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, ABIKind Kind,
+ PPC64_SVR4_ABIInfo(CodeGen::CodeGenTypes &CGT, PPC64_SVR4_ABIKind Kind,
bool SoftFloatABI)
: ABIInfo(CGT), Kind(Kind), IsSoftFloatABI(SoftFloatABI) {}
@@ -5035,8 +5032,7 @@ class PPC64_SVR4_ABIInfo : public ABIInfo {
class PPC64_SVR4_TargetCodeGenInfo : public TargetCodeGenInfo {
public:
- PPC64_SVR4_TargetCodeGenInfo(CodeGenTypes &CGT,
- PPC64_SVR4_ABIInfo::ABIKind Kind,
+ PPC64_SVR4_TargetCodeGenInfo(CodeGenTypes &CGT, PPC64_SVR4_ABIKind Kind,
bool SoftFloatABI)
: TargetCodeGenInfo(
std::make_unique<PPC64_SVR4_ABIInfo>(CGT, Kind, SoftFloatABI)) {
@@ -5135,7 +5131,7 @@ CharUnits PPC64_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const {
// Likewise for ELFv2 homogeneous aggregates.
const Type *Base = nullptr;
uint64_t Members = 0;
- if (!AlignAsType && Kind == ELFv2 &&
+ if (!AlignAsType && Kind == PPC64_SVR4_ABIKind::ELFv2 &&
isAggregateTypeForABI(Ty) && isHomogeneousAggregate(Ty, Base, Members))
AlignAsType = Base;
@@ -5329,7 +5325,7 @@ PPC64_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const {
// ELFv2 homogeneous aggregates are passed as array types.
const Type *Base = nullptr;
uint64_t Members = 0;
- if (Kind == ELFv2 &&
+ if (Kind == PPC64_SVR4_ABIKind::ELFv2 &&
isHomogeneousAggregate(Ty, Base, Members)) {
llvm::Type *BaseTy = CGT.ConvertType(QualType(Base, 0));
llvm::Type *CoerceTy = llvm::ArrayType::get(BaseTy, Members);
@@ -5399,7 +5395,7 @@ PPC64_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const {
// ELFv2 homogeneous aggregates are returned as array types.
const Type *Base = nullptr;
uint64_t Members = 0;
- if (Kind == ELFv2 &&
+ if (Kind == PPC64_SVR4_ABIKind::ELFv2 &&
isHomogeneousAggregate(RetTy, Base, Members)) {
llvm::Type *BaseTy = CGT.ConvertType(QualType(Base, 0));
llvm::Type *CoerceTy = llvm::ArrayType::get(BaseTy, Members);
@@ -5408,7 +5404,7 @@ PPC64_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const {
// ELFv2 small aggregates are returned in up to two registers.
uint64_t Bits = getContext().getTypeSize(RetTy);
- if (Kind == ELFv2 && Bits <= 2 * GPRBits) {
+ if (Kind == PPC64_SVR4_ABIKind::ELFv2 && Bits <= 2 * GPRBits) {
if (Bits == 0)
return ABIArgInfo::getIgnore();
@@ -5489,23 +5485,22 @@ PPC64TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
namespace {
-class AArch64ABIInfo : public ABIInfo {
-public:
- enum ABIKind {
- AAPCS = 0,
- DarwinPCS,
- Win64
- };
+enum class AArch64ABIKind {
+ AAPCS = 0,
+ DarwinPCS,
+ Win64,
+};
-private:
- ABIKind Kind;
+class AArch64ABIInfo : public ABIInfo {
+ AArch64ABIKind Kind;
public:
- AArch64ABIInfo(CodeGenTypes &CGT, ABIKind Kind) : ABIInfo(CGT), Kind(Kind) {}
+ AArch64ABIInfo(CodeGenTypes &CGT, AArch64ABIKind Kind)
+ : ABIInfo(CGT), Kind(Kind) {}
private:
- ABIKind getABIKind() const { return Kind; }
- bool isDarwinPCS() const { return Kind == DarwinPCS; }
+ AArch64ABIKind getABIKind() const { return Kind; }
+ bool isDarwinPCS() const { return Kind == AArch64ABIKind::DarwinPCS; }
ABIArgInfo classifyReturnType(QualType RetTy, bool IsVariadic) const;
ABIArgInfo classifyArgumentType(QualType RetTy, bool IsVariadic,
@@ -5541,8 +5536,8 @@ class AArch64ABIInfo : public ABIInfo {
llvm::report_fatal_error("Passing SVE types to variadic functions is "
"currently not supported");
- return Kind == Win64 ? EmitMSVAArg(CGF, VAListAddr, Ty)
- : isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF)
+ return Kind == AArch64ABIKind::Win64 ? EmitMSVAArg(CGF, VAListAddr, Ty)
+ : isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF)
: EmitAAPCSVAArg(VAListAddr, Ty, CGF);
}
@@ -5565,7 +5560,7 @@ class AArch64SwiftABIInfo : public SwiftABIInfo {
class AArch64TargetCodeGenInfo : public TargetCodeGenInfo {
public:
- AArch64TargetCodeGenInfo(CodeGenTypes &CGT, AArch64ABIInfo::ABIKind Kind)
+ AArch64TargetCodeGenInfo(CodeGenTypes &CGT, AArch64ABIKind Kind)
: TargetCodeGenInfo(std::make_unique<AArch64ABIInfo>(CGT, Kind)) {
SwiftInfo = std::make_unique<AArch64SwiftABIInfo>(CGT);
}
@@ -5633,7 +5628,7 @@ class AArch64TargetCodeGenInfo : public TargetCodeGenInfo {
class WindowsAArch64TargetCodeGenInfo : public AArch64TargetCodeGenInfo {
public:
- WindowsAArch64TargetCodeGenInfo(CodeGenTypes &CGT, AArch64ABIInfo::ABIKind K)
+ WindowsAArch64TargetCodeGenInfo(CodeGenTypes &CGT, AArch64ABIKind K)
: AArch64TargetCodeGenInfo(CGT, K) {}
void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
@@ -5791,12 +5786,13 @@ AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadic,
// Homogeneous Floating-point Aggregates (HFAs) need to be expanded.
const Type *Base = nullptr;
uint64_t Members = 0;
- bool IsWin64 = Kind == Win64 || CallingConvention == llvm::CallingConv::Win64;
+ bool IsWin64 = Kind == AArch64ABIKind::Win64 ||
+ CallingConvention == llvm::CallingConv::Win64;
bool IsWinVariadic = IsWin64 && IsVariadic;
// In variadic functions on Windows, all composite types are treated alike,
// no special handling of HFAs/HVAs.
if (!IsWinVariadic && isHomogeneousAggregate(Ty, Base, Members)) {
- if (Kind != AArch64ABIInfo::AAPCS)
+ if (Kind != AArch64ABIKind::AAPCS)
return ABIArgInfo::getDirect(
llvm::ArrayType::get(CGT.ConvertType(QualType(Base, 0)), Members));
@@ -5819,7 +5815,7 @@ AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadic,
return coerceToIntArray(Ty, getContext(), getVMContext());
}
unsigned Alignment;
- if (Kind == AArch64ABIInfo::AAPCS) {
+ if (Kind == AArch64ABIKind::AAPCS) {
Alignment = getContext().getTypeUnadjustedAlign(Ty);
Alignment = Alignment < 128 ? 64 : 128;
} else {
@@ -6298,21 +6294,19 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr,
namespace {
-class ARMABIInfo : public ABIInfo {
-public:
- enum ABIKind {
- APCS = 0,
- AAPCS = 1,
- AAPCS_VFP = 2,
- AAPCS16_VFP = 3,
- };
+enum class ARMABIKind {
+ APCS = 0,
+ AAPCS = 1,
+ AAPCS_VFP = 2,
+ AAPCS16_VFP = 3,
+};
-private:
- ABIKind Kind;
+class ARMABIInfo : public ABIInfo {
+ ARMABIKind Kind;
bool IsFloatABISoftFP;
public:
- ARMABIInfo(CodeGenTypes &CGT, ABIKind Kind) : ABIInfo(CGT), Kind(Kind) {
+ ARMABIInfo(CodeGenTypes &CGT, ARMABIKind Kind) : ABIInfo(CGT), Kind(Kind) {
setCCs();
IsFloatABISoftFP = CGT.getCodeGenOpts().FloatABI == "softfp" ||
CGT.getCodeGenOpts().FloatABI == ""; // default
@@ -6344,7 +6338,7 @@ class ARMABIInfo : public ABIInfo {
}
}
- ABIKind getABIKind() const { return Kind; }
+ ARMABIKind getABIKind() const { return Kind; }
bool allowBFloatArgsAndRet() const override {
return !IsFloatABISoftFP && getTarget().hasBFloat16Type();
@@ -6389,7 +6383,7 @@ class ARMSwiftABIInfo : public SwiftABIInfo {
class ARMTargetCodeGenInfo : public TargetCodeGenInfo {
public:
- ARMTargetCodeGenInfo(CodeGenTypes &CGT, ARMABIInfo::ABIKind K)
+ ARMTargetCodeGenInfo(CodeGenTypes &CGT, ARMABIKind K)
: TargetCodeGenInfo(std::make_unique<ARMABIInfo>(CGT, K)) {
SwiftInfo = std::make_unique<ARMSwiftABIInfo>(CGT);
}
@@ -6483,8 +6477,8 @@ class ARMTargetCodeGenInfo : public TargetCodeGenInfo {
Fn->addFnAttr("interrupt", Kind);
- ARMABIInfo::ABIKind ABI = cast<ARMABIInfo>(getABIInfo()).getABIKind();
- if (ABI == ARMABIInfo::APCS)
+ ARMABIKind ABI = cast<ARMABIInfo>(getABIInfo()).getABIKind();
+ if (ABI == ARMABIKind::APCS)
return;
// AAPCS guarantees that sp will be 8-byte aligned on any public interface,
@@ -6498,7 +6492,7 @@ class ARMTargetCodeGenInfo : public TargetCodeGenInfo {
class WindowsARMTargetCodeGenInfo : public ARMTargetCodeGenInfo {
public:
- WindowsARMTargetCodeGenInfo(CodeGenTypes &CGT, ARMABIInfo::ABIKind K)
+ WindowsARMTargetCodeGenInfo(CodeGenTypes &CGT, ARMABIKind K)
: ARMTargetCodeGenInfo(CGT, K) {}
void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
@@ -6558,10 +6552,14 @@ llvm::CallingConv::ID ARMABIInfo::getLLVMDefaultCC() const {
/// as the C calling convention.
llvm::CallingConv::ID ARMABIInfo::getABIDefaultCC() const {
switch (getABIKind()) {
- case APCS: return llvm::CallingConv::ARM_APCS;
- case AAPCS: return llvm::CallingConv::ARM_AAPCS;
- case AAPCS_VFP: return llvm::CallingConv::ARM_AAPCS_VFP;
- case AAPCS16_VFP: return llvm::CallingConv::ARM_AAPCS_VFP;
+ case ARMABIKind::APCS:
+ return llvm::CallingConv::ARM_APCS;
+ case ARMABIKind::AAPCS:
+ return llvm::CallingConv::ARM_AAPCS;
+ case ARMABIKind::AAPCS_VFP:
+ return llvm::CallingConv::ARM_AAPCS_VFP;
+ case ARMABIKind::AAPCS16_VFP:
+ return llvm::CallingConv::ARM_AAPCS_VFP;
}
llvm_unreachable("bad ABI kind");
}
@@ -6607,8 +6605,8 @@ ABIArgInfo ARMABIInfo::classifyHomogeneousAggregate(QualType Ty,
}
}
unsigned Align = 0;
- if (getABIKind() == ARMABIInfo::AAPCS ||
- getABIKind() == ARMABIInfo::AAPCS_VFP) {
+ if (getABIKind() == ARMABIKind::AAPCS ||
+ getABIKind() == ARMABIKind::AAPCS_VFP) {
// For alignment adjusted HFAs, cap the argument alignment to 8, leave it
// default otherwise.
Align = getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity();
@@ -6666,7 +6664,7 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic,
uint64_t Members = 0;
if (isHomogeneousAggregate(Ty, Base, Members))
return classifyHomogeneousAggregate(Ty, Base, Members);
- } else if (getABIKind() == ARMABIInfo::AAPCS16_VFP) {
+ } else if (getABIKind() == ARMABIKind::AAPCS16_VFP) {
// WatchOS does have homogeneous aggregates. Note that we intentionally use
// this convention even for a variadic function: the backend will use GPRs
// if needed.
@@ -6680,7 +6678,7 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic,
}
}
- if (getABIKind() == ARMABIInfo::AAPCS16_VFP &&
+ if (getABIKind() == ARMABIKind::AAPCS16_VFP &&
getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(16)) {
// WatchOS is adopting the 64-bit AAPCS rule on composite types: if they're
// bigger than 128-bits, they get placed in space allocated by the caller,
@@ -6695,15 +6693,15 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic,
// than ABI alignment.
uint64_t ABIAlign = 4;
uint64_t TyAlign;
- if (getABIKind() == ARMABIInfo::AAPCS_VFP ||
- getABIKind() == ARMABIInfo::AAPCS) {
+ if (getABIKind() == ARMABIKind::AAPCS_VFP ||
+ getABIKind() == ARMABIKind::AAPCS) {
TyAlign = getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity();
ABIAlign = std::clamp(TyAlign, (uint64_t)4, (uint64_t)8);
} else {
TyAlign = getContext().getTypeAlignInChars(Ty).getQuantity();
}
if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64)) {
- assert(getABIKind() != ARMABIInfo::AAPCS16_VFP && "unexpected byval");
+ assert(getABIKind() != ARMABIKind::AAPCS16_VFP && "unexpected byval");
return ABIArgInfo::getIndirect(CharUnits::fromQuantity(ABIAlign),
/*ByVal=*/true,
/*Realign=*/TyAlign > ABIAlign);
@@ -6854,7 +6852,7 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy, bool isVariadic,
}
// Are we following APCS?
- if (getABIKind() == APCS) {
+ if (getABIKind() == ARMABIKind::APCS) {
if (isEmptyRecord(getContext(), RetTy, false))
return ABIArgInfo::getIgnore();
@@ -6913,7 +6911,7 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy, bool isVariadic,
if (Size <= 16)
return ABIArgInfo::getDirect(llvm::Type::getInt16Ty(getVMContext()));
return ABIArgInfo::getDirect(llvm::Type::getInt32Ty(getVMContext()));
- } else if (Size <= 128 && getABIKind() == AAPCS16_VFP) {
+ } else if (Size <= 128 && getABIKind() == ARMABIKind::AAPCS16_VFP) {
llvm::Type *Int32Ty = llvm::Type::getInt32Ty(getVMContext());
llvm::Type *CoerceTy =
llvm::ArrayType::get(Int32Ty, llvm::alignTo(Size, 32) / 32);
@@ -7043,8 +7041,8 @@ bool ARMABIInfo::isEffectivelyAAPCS_VFP(unsigned callConvention,
if (callConvention != llvm::CallingConv::C)
return (callConvention == llvm::CallingConv::ARM_AAPCS_VFP);
else
- return (getABIKind() == AAPCS_VFP) ||
- (acceptHalf && (getABIKind() == AAPCS16_VFP));
+ return (getABIKind() == ARMABIKind::AAPCS_VFP) ||
+ (acceptHalf && (getABIKind() == ARMABIKind::AAPCS16_VFP));
}
Address ARMABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
@@ -7072,7 +7070,7 @@ Address ARMABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
// ARMv7k passes structs bigger than 16 bytes indirectly, in space
// allocated by the caller.
} else if (TySize > CharUnits::fromQuantity(16) &&
- getABIKind() == ARMABIInfo::AAPCS16_VFP &&
+ getABIKind() == ARMABIKind::AAPCS16_VFP &&
!isHomogeneousAggregate(Ty, Base, Members)) {
IsIndirect = true;
@@ -7080,11 +7078,11 @@ Address ARMABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
// The ABI alignment for 64-bit or 128-bit vectors is 8 for AAPCS and 4 for
// APCS. For AAPCS, the ABI alignment is at least 4-byte and at most 8-byte.
// Our callers should be prepared to handle an under-aligned address.
- } else if (getABIKind() == ARMABIInfo::AAPCS_VFP ||
- getABIKind() == ARMABIInfo::AAPCS) {
+ } else if (getABIKind() == ARMABIKind::AAPCS_VFP ||
+ getABIKind() == ARMABIKind::AAPCS) {
TyAlignForABI = std::max(TyAlignForABI, CharUnits::fromQuantity(4));
TyAlignForABI = std::min(TyAlignForABI, CharUnits::fromQuantity(8));
- } else if (getABIKind() == ARMABIInfo::AAPCS16_VFP) {
+ } else if (getABIKind() == ARMABIKind::AAPCS16_VFP) {
// ARMv7k allows type alignment up to 16 bytes.
TyAlignForABI = std::max(TyAlignForABI, CharUnits::fromQuantity(4));
TyAlignForABI = std::min(TyAlignForABI, CharUnits::fromQuantity(16));
@@ -12332,21 +12330,21 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
case llvm::Triple::aarch64:
case llvm::Triple::aarch64_32:
case llvm::Triple::aarch64_be: {
- AArch64ABIInfo::ABIKind Kind = AArch64ABIInfo::AAPCS;
+ AArch64ABIKind Kind = AArch64ABIKind::AAPCS;
if (getTarget().getABI() == "darwinpcs")
- Kind = AArch64ABIInfo::DarwinPCS;
+ Kind = AArch64ABIKind::DarwinPCS;
else if (Triple.isOSWindows())
return SetCGInfo(
- new WindowsAArch64TargetCodeGenInfo(Types, AArch64ABIInfo::Win64));
+ new WindowsAArch64TargetCodeGenInfo(Types, AArch64ABIKind::Win64));
return SetCGInfo(new AArch64TargetCodeGenInfo(Types, Kind));
}
case llvm::Triple::wasm32:
case llvm::Triple::wasm64: {
- WebAssemblyABIInfo::ABIKind Kind = WebAssemblyABIInfo::MVP;
+ WebAssemblyABIKind Kind = WebAssemblyABIKind::MVP;
if (getTarget().getABI() == "experimental-mv")
- Kind = WebAssemblyABIInfo::ExperimentalMV;
+ Kind = WebAssemblyABIKind::ExperimentalMV;
return SetCGInfo(new WebAssemblyTargetCodeGenInfo(Types, Kind));
}
@@ -12356,21 +12354,21 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
case llvm::Triple::thumbeb: {
if (Triple.getOS() == llvm::Triple::Win32) {
return SetCGInfo(
- new WindowsARMTargetCodeGenInfo(Types, ARMABIInfo::AAPCS_VFP));
+ new WindowsARMTargetCodeGenInfo(Types, ARMABIKind::AAPCS_VFP));
}
- ARMABIInfo::ABIKind Kind = ARMABIInfo::AAPCS;
+ ARMABIKind Kind = ARMABIKind::AAPCS;
StringRef ABIStr = getTarget().getABI();
if (ABIStr == "apcs-gnu")
- Kind = ARMABIInfo::APCS;
+ Kind = ARMABIKind::APCS;
else if (ABIStr == "aapcs16")
- Kind = ARMABIInfo::AAPCS16_VFP;
+ Kind = ARMABIKind::AAPCS16_VFP;
else if (CodeGenOpts.FloatABI == "hard" ||
(CodeGenOpts.FloatABI != "soft" &&
(Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
Triple.getEnvironment() == llvm::Triple::MuslEABIHF ||
Triple.getEnvironment() == llvm::Triple::EABIHF)))
- Kind = ARMABIInfo::AAPCS_VFP;
+ Kind = ARMABIKind::AAPCS_VFP;
return SetCGInfo(new ARMTargetCodeGenInfo(Types, Kind));
}
@@ -12398,9 +12396,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
if (Triple.isOSBinFormatELF()) {
- PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+ PPC64_SVR4_ABIKind Kind = PPC64_SVR4_ABIKind::ELFv1;
if (getTarget().getABI() == "elfv2")
- Kind = PPC64_SVR4_ABIInfo::ELFv2;
+ Kind = PPC64_SVR4_ABIKind::ELFv2;
bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
return SetCGInfo(
@@ -12409,9 +12407,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
return SetCGInfo(new PPC64TargetCodeGenInfo(Types));
case llvm::Triple::ppc64le: {
assert(Triple.isOSBinFormatELF() && "PPC64 LE non-ELF not supported!");
- PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
+ PPC64_SVR4_ABIKind Kind = PPC64_SVR4_ABIKind::ELFv2;
if (getTarget().getABI() == "elfv1")
- Kind = PPC64_SVR4_ABIInfo::ELFv1;
+ Kind = PPC64_SVR4_ABIKind::ELFv1;
bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
return SetCGInfo(
More information about the cfe-commits
mailing list