[flang-commits] [flang] [flang][driver] do not crash when fc1 process multiple files (PR #138875)

David Truby via flang-commits flang-commits at lists.llvm.org
Thu May 8 09:56:05 PDT 2025


DavidTruby wrote:

Sorry, @inaki-amatria's comment has made me realise I didn't look at this closely enough; I clearly only skim read the commit message, and the code change looked sensible to me.
I've checked what clang -cc1 does here, and that only accepts the last flag. I.e. `clang -cc1 -o test.o -x c test.c -o test2.o -x c test2.c` will only genereate `test2.o`. It does this silently, i.e. it doesn't give you any warning that you've passed multiple files.

I'm not opposed to `flang -fc1` accepting it even though `clang -cc1` doesn't, but I'm not actually clear what the expected behaviour would be with `flang -fc1` accepting multiple input files. What happens with this change?

I do think that making this re-entrant is sensible anyway for library users as @inaki-amatria mentioned so my accept still stands.

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


More information about the flang-commits mailing list