================
@@ -5739,6 +5739,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
       if (CM == "large" && RelocationModel != llvm::Reloc::Static)
         D.Diag(diag::err_drv_argument_only_allowed_with)
             << A->getAsString(Args) << "-fno-pic";
+    } else if (Triple.isLoongArch()) {
+      CM = llvm::StringSwitch<StringRef>(CM)
+               .Case("normal", "small")
+               .Case("extreme", "large")
+               .Default(CM);
+      if (CM == "large" &&
+          Args.hasFlag(options::OPT_fplt, options::OPT_fno_plt, false))
----------------
MaskRay wrote:

I consider -fno-pic/-fpic a more fundamental difference than -mcmodel=, so I 
place the aarch64 compatibility check in this large `if` condition.

-mcmodel= is a more fundamental difference than -fplt, so the -fplt 
compatibility check should probably belong to -fplt. You can move 

```
if (Args.hasFlag(options::OPT_fno_plt, options::OPT_fplt, false)) {
```
below CodeModel check and add the diagnostic there.

https://github.com/llvm/llvm-project/pull/72514
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to