mmha wrote:
I mostly wondered about the expected behavior in these cases:
```
clang foo.cpp bar.cir
clang -emit-cir foo.cpp bar.cir
clang -emit-llvm foo.cpp bar.cir
```
I wouldn't want the presence of a .cir file to implicitly change the pipeline
of the other files. But in `ExecuteCompilerInvocation.cpp` we need to decide
whether to enable CIR or not based on all input files. So I was looking for
ways to make the enablement of CIR more explicit.
To me `-emit-cir` means "dump the IR" and not "change the pipeline, then dump
the IR". I think it's better to require two separate flags. If no CIR is
generated during compilation this shouldn't do anything, just like `-emit-ast`
errors out for LLVM IR files.
This patch isn't necessary for enable CIR as a source lang but note the
`llvm::report_fatal_error("-emit-cir and only valid when using -fclangir");`
line I deleted. This was dead code but the string suggests this was the
intended behavior.
https://github.com/llvm/llvm-project/pull/166916
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits