@@ -52,6 +52,9 @@ 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 ;
5558 case llvm::Triple::EnvironmentType::GNUSF:
5659 case llvm::Triple::EnvironmentType::MuslSF:
5760 TripleABI = Is64Bit ? ABI_LP64S : ABI_ILP32S;
@@ -96,7 +99,7 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
9699
97100 // 1. If the '-target-abi' is valid, use it.
98101 if (IsABIValidForFeature (ArgProvidedABI)) {
99- if (TT. hasEnvironment ( ) && ArgProvidedABI != TripleABI)
102+ if (IsABIValidForFeature (TripleABI ) && ArgProvidedABI != TripleABI)
100103 errs ()
101104 << " warning: triple-implied ABI conflicts with provided target-abi '"
102105 << ABIName << " ', using target-abi\n " ;
@@ -164,10 +167,7 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
164167 return Is64Bit ? ABI_LP64F : ABI_ILP32F;
165168 return Is64Bit ? ABI_LP64S : ABI_ILP32S;
166169 };
167- if (ABIName.empty ())
168- errs () << " warning: the triple-implied ABI is invalid, ignoring and using "
169- " feature-implied ABI\n " ;
170- else
170+ if (!ABIName.empty ())
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