garvitgupta08 added inline comments.

================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:976-985
+  bool IsInputTyAsm = false;
+  for (const auto &II : Inputs) {
+    CmdArgs.push_back(II.getFilename());
+    StringRef BaseInput = StringRef(II.getBaseInput());
+    types::ID InputType = types::lookupTypeForExtension(
+        llvm::sys::path::extension(BaseInput).drop_front());
+    if (InputType == types::TY_Asm || InputType == types::TY_PP_Asm)
----------------
nickdesaulniers wrote:
> garvitgupta08 wrote:
> > nickdesaulniers wrote:
> > > Thinking about this more, does the issue still exist if the user passed 
> > > .c and .s/.S files together?
> > > 
> > > i.e. `$ clang ... -fno-integrated-as -gdwarf-4 foo.s main.c`?
> > Yes, the error will still be thrown for c/cpp files.
> So this patch is an incomplete fix then? Is there somewhere else we can move 
> this logic then so that it's only applied for individual files and not 
> multiple inputs?
No. I misunderstood your question. I thought you were asking what will happen 
in case of multiple inputs without this fix. I answered according to this. 

The current patch fixes the error in case of multiple inputs as well. No error 
will be thrown for c/cpp files. I hope this answers your original question.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145726/new/

https://reviews.llvm.org/D145726

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to