mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 17:06:07 +00:00
:createMCStreamer: delete InstPrinter on error
This commit is contained in:
parent
d1badf5635
commit
2b8cc651dc
@ -166,9 +166,12 @@ CodeGenTargetMachineImpl::createMCStreamer(raw_pwrite_stream &Out,
|
||||
getTargetTriple(),
|
||||
Options.MCOptions.OutputAsmVariant.value_or(MAI.getAssemblerDialect()),
|
||||
MAI, MII, MRI);
|
||||
for (StringRef Opt : Options.MCOptions.InstPrinterOptions)
|
||||
if (!InstPrinter->applyTargetSpecificCLOption(Opt))
|
||||
for (StringRef Opt : Options.MCOptions.InstPrinterOptions) {
|
||||
if (!InstPrinter->applyTargetSpecificCLOption(Opt)) {
|
||||
delete InstPrinter;
|
||||
return createStringError("invalid InstPrinter option '" + Opt + "'");
|
||||
}
|
||||
}
|
||||
|
||||
// Create a code emitter if asked to show the encoding.
|
||||
std::unique_ptr<MCCodeEmitter> MCE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user