[lld] [lld][COFF][LTO] Implement /lldemit:asm option (PR #67079)

Matheus Izvekov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 06:21:07 PDT 2023


================
@@ -87,13 +87,21 @@ lto::Config BitcodeCompiler::createConfig() {
   c.RunCSIRInstr = ctx.config.ltoCSProfileGenerate;
   c.PGOWarnMismatch = ctx.config.ltoPGOWarnMismatch;
 
-  if (ctx.config.emit == EmitKind::LLVM) {
+  switch (ctx.config.emit) {
+  case EmitKind::Obj:
----------------
mizvekov wrote:

We do, the normal `Obj` case runs here as well.

>From what I remember, folks here tend to prefer to not add a default case for a switch on an enum, because otherwise you lose the more useful `case not handled` warning.

If you think it's worth catching the UB here anyway, maybe we can refactor this so we hit the unreachable case when flowing to the next statement instead?

https://github.com/llvm/llvm-project/pull/67079


More information about the llvm-commits mailing list