@@ -52,9 +52,6 @@ static ABI getTripleABI(const Triple &TT) {
5252 bool Is64Bit = TT.isArch64Bit ();
5353 ABI TripleABI;
5454 switch (TT.getEnvironment ()) {
55- case llvm::Triple::EnvironmentType::UnknownEnvironment:
56- TripleABI = ABI_Unknown;
57- break ;
5855 case llvm::Triple::EnvironmentType::GNUSF:
5956 case llvm::Triple::EnvironmentType::MuslSF:
6057 TripleABI = Is64Bit ? ABI_LP64S : ABI_ILP32S;
@@ -99,7 +96,7 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
9996
10097 // 1. If the '-target-abi' is valid, use it.
10198 if (IsABIValidForFeature (ArgProvidedABI)) {
102- if (IsABIValidForFeature (TripleABI ) && ArgProvidedABI != TripleABI)
99+ if (TT. hasEnvironment ( ) && ArgProvidedABI != TripleABI)
103100 errs ()
104101 << " warning: triple-implied ABI conflicts with provided target-abi '"
105102 << ABIName << " ', using target-abi\n " ;
@@ -167,7 +164,10 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
167164 return Is64Bit ? ABI_LP64F : ABI_ILP32F;
168165 return Is64Bit ? ABI_LP64S : ABI_ILP32S;
169166 };
170- if (!ABIName.empty ())
167+ if (ABIName.empty ())
168+ errs () << " warning: the triple-implied ABI is invalid, ignoring and using "
169+ " feature-implied ABI\n " ;
170+ else
171171 errs () << " warning: both target-abi and the triple-implied ABI are "
172172 " invalid, ignoring and using feature-implied ABI\n " ;
173173 return checkABIStandardized (GetFeatureABI ());
0 commit comments