22namespace LoongArchABI {
47 errs() <<
"warning: '" << ABIName <<
"' has not been standardized\n";
52 bool Is64Bit = TT.isArch64Bit();
54 switch (TT.getEnvironment()) {
74 bool Is64Bit = TT.isArch64Bit();
78 auto IsABIValidForFeature = [=](
ABI Abi) {
85 return !Is64Bit && FeatureBits[LoongArch::FeatureBasicF];
87 return !Is64Bit && FeatureBits[LoongArch::FeatureBasicD];
91 return Is64Bit && FeatureBits[LoongArch::FeatureBasicF];
93 return Is64Bit && FeatureBits[LoongArch::FeatureBasicD];
98 if (IsABIValidForFeature(ArgProvidedABI)) {
99 if (TT.hasEnvironment() && ArgProvidedABI != TripleABI)
101 <<
"warning: triple-implied ABI conflicts with provided target-abi '"
102 << ABIName <<
"', using target-abi\n";
107 if (IsABIValidForFeature(TripleABI)) {
112 switch (ArgProvidedABI) {
116 errs() <<
"warning: the '" << ABIName
117 <<
"' is not a recognized ABI for this target, ignoring and "
118 "using triple-implied ABI\n";
124 errs() <<
"warning: 32-bit ABIs are not supported for 64-bit targets, "
125 "ignoring and using triple-implied ABI\n";
133 errs() <<
"warning: 64-bit ABIs are not supported for 32-bit targets, "
134 "ignoring and using triple-implied ABI\n";
140 switch (ArgProvidedABI) {
143 errs() <<
"warning: the '" << ABIName
144 <<
"' ABI can't be used for a target that doesn't support the 'F' "
145 "instruction set, ignoring and using triple-implied ABI\n";
149 errs() <<
"warning: the '" << ABIName
150 <<
"' ABI can't be used for a target that doesn't support the 'D' "
151 "instruction set, ignoring and using triple-implied ABI\n";
160 auto GetFeatureABI = [=]() {
161 if (FeatureBits[LoongArch::FeatureBasicD])
163 if (FeatureBits[LoongArch::FeatureBasicF])
168 errs() <<
"warning: the triple-implied ABI is invalid, ignoring and using "
169 "feature-implied ABI\n";
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.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.