[llvm] Replace DCHECK() with Status error.
@@ -72,8 +72,12 @@ Status getTextSizeInBytes(llvm::Module& module, int64_t* value, const fs::path&
#endif
const auto clangPath = util::getSiteDataPath("llvm/10.0.0/bin/clang");
const auto llvmSizePath = util::getSiteDataPath("llvm/10.0.0/bin/llvm-size");
- DCHECK(fs::exists(clangPath)) << "File not found: " << clangPath.string();
- DCHECK(fs::exists(llvmSizePath)) << "File not found: " << llvmSizePath.string();
+ if (!fs::exists(clangPath)) {
+ return Status(StatusCode::INTERNAL, fmt::format("File not found: {}", clangPath.string()));
+ }
+ if (!fs::exists(llvmSizePath)) {
+ return Status(StatusCode::INTERNAL, fmt::format("File not found: {}", llvmSizePath.string()));
+ }
// Lower the module to an object file using clang and extract the .text
// section size using llvm-size.
