Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/include/clang/Basic/DiagnosticFrontendKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def err_fe_unable_to_load_plugin : Error<
"unable to load plugin '%0': '%1'">;
def err_fe_unable_to_create_target : Error<
"unable to create target: '%0'">;
def err_fe_unable_to_create_subtarget : Error<
"unable to create subtarget: '%0'%select{ with features '%2'|}1">;
def err_fe_unable_to_interface_with_target : Error<
"unable to interface with target machine">;
def err_fe_unable_to_open_output : Error<
Expand Down
5 changes: 4 additions & 1 deletion clang/tools/driver/cc1as_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,10 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,

std::unique_ptr<MCSubtargetInfo> STI(
TheTarget->createMCSubtargetInfo(Opts.Triple, Opts.CPU, FS));
assert(STI && "Unable to create subtarget info!");
if (!STI) {
return Diags.Report(diag::err_fe_unable_to_create_subtarget)
<< Opts.CPU << FS.empty() << FS;
}

MCContext Ctx(Triple(Opts.Triple), MAI.get(), MRI.get(), STI.get(), &SrcMgr,
&MCOptions);
Expand Down