[clang] [clang][driver][darwin] Report bad SDKSettings as a fatal error rather than unreachable (PR #175073)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 8 13:34:28 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Ian Anderson (ian-twilightcoder)
<details>
<summary>Changes</summary>
Fatal error is more appropriate than unreachable when the SDKSettings is not in a recognized form (encountered in a few tests with incomplete SDKSettings.json).
---
Full diff: https://github.com/llvm/llvm-project/pull/175073.diff
1 Files Affected:
- (modified) clang/lib/Basic/DarwinSDKInfo.cpp (+3-1)
``````````diff
diff --git a/clang/lib/Basic/DarwinSDKInfo.cpp b/clang/lib/Basic/DarwinSDKInfo.cpp
index 4fd31b841b23d..b55ffd1c39a86 100644
--- a/clang/lib/Basic/DarwinSDKInfo.cpp
+++ b/clang/lib/Basic/DarwinSDKInfo.cpp
@@ -112,7 +112,9 @@ parsePlatformInfos(const llvm::json::Object &Obj, VersionTuple Version) {
llvm::Triple::UnknownEnvironment,
llvm::Triple::MachO, "/System/DriverKit"});
} else {
- llvm_unreachable("Unrecognized Xcode platform");
+ llvm::reportFatalUsageError(
+ "Unrecognized CanonicalName in SDKSettings.json. SupportedTargets is "
+ "expected, or a recognized CanonicalName.");
}
return PlatformInfos;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/175073
More information about the cfe-commits
mailing list