22namespace LoongArchABI {
47 errs() <<
"warning: '" << ABIName <<
"' has not been standardized\n";
52 bool Is64Bit = TT.isArch64Bit();
54 switch (TT.getEnvironment()) {
77 bool Is64Bit = TT.isArch64Bit();
81 auto IsABIValidForFeature = [=](
ABI Abi) {
88 return !Is64Bit && FeatureBits[LoongArch::FeatureBasicF];
90 return !Is64Bit && FeatureBits[LoongArch::FeatureBasicD];
94 return Is64Bit && FeatureBits[LoongArch::FeatureBasicF];
96 return Is64Bit && FeatureBits[LoongArch::FeatureBasicD];
101 if (IsABIValidForFeature(ArgProvidedABI)) {
102 if (IsABIValidForFeature(TripleABI) && ArgProvidedABI != TripleABI)
104 <<
"warning: triple-implied ABI conflicts with provided target-abi '"
105 << ABIName <<
"', using target-abi\n";
110 if (IsABIValidForFeature(TripleABI)) {
115 switch (ArgProvidedABI) {
119 errs() <<
"warning: the '" << ABIName
120 <<
"' is not a recognized ABI for this target, ignoring and "
121 "using triple-implied ABI\n";
127 errs() <<
"warning: 32-bit ABIs are not supported for 64-bit targets, "
128 "ignoring and using triple-implied ABI\n";
136 errs() <<
"warning: 64-bit ABIs are not supported for 32-bit targets, "
137 "ignoring and using triple-implied ABI\n";
143 switch (ArgProvidedABI) {
146 errs() <<
"warning: the '" << ABIName
147 <<
"' ABI can't be used for a target that doesn't support the 'F' "
148 "instruction set, ignoring and using triple-implied ABI\n";
152 errs() <<
"warning: the '" << ABIName
153 <<
"' ABI can't be used for a target that doesn't support the 'D' "
154 "instruction set, ignoring and using triple-implied ABI\n";
163 auto GetFeatureABI = [=]() {
164 if (FeatureBits[LoongArch::FeatureBasicD])
166 if (FeatureBits[LoongArch::FeatureBasicF])
170 if (!ABIName.
empty())
171 errs() <<
"warning: both target-abi and the triple-implied ABI are "
172 "invalid, ignoring and using feature-implied ABI\n";
Container class for subtarget features.
Wrapper class representing physical registers. Should be passed by value.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static ABI checkABIStandardized(ABI Abi)
static ABI getTripleABI(const Triple &TT)
ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, StringRef ABIName)
ABI getTargetABI(StringRef ABIName)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.