[llvm] [llc] Change `TargetMachine` allocation assert to error (PR #189541)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 31 01:11:36 PDT 2026
================
@@ -617,7 +617,11 @@ static int compileModule(char **argv, SmallVectorImpl<PassPlugin> &PluginList,
// to avoid a memory leak.
Target = std::unique_ptr<TargetMachine>(TheTarget->createTargetMachine(
TheTriple, SkipModuleCPU, FeaturesStr, Options, RM, CM, OLvl));
- assert(Target && "Could not allocate target machine!");
+ if (!Target) {
+ WithColor::error(errs(), argv[0])
+ << "Could not allocate target machine!\n";
----------------
arsenm wrote:
```suggestion
<< "could not allocate target machine\n";
```
https://github.com/llvm/llvm-project/pull/189541
More information about the llvm-commits
mailing list