[flang-commits] [clang] [flang] [Flang] Add code-object-version option (PR #72638)

Andrzej WarzyƄski via flang-commits flang-commits at lists.llvm.org
Sun Nov 19 05:27:50 PST 2023


================
@@ -264,6 +263,37 @@ static void addDepdendentLibs(mlir::ModuleOp &mlirModule,
   }
 }
 
+// Add to MLIR code target specific items which are dependent on target
+// configuration specified by the user
+static void addTargetSpecificMLIRItems(mlir::ModuleOp &mlirModule,
+                                       CompilerInstance &ci) {
+  const TargetOptions &targetOpts = ci.getInvocation().getTargetOpts();
+  const llvm::Triple triple(targetOpts.triple);
+  if (triple.isAMDGPU()) {
----------------
banach-space wrote:

Please avoid indentation where possible (https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code):

```suggestion
  if (! triple.isAMDGPU())
    return
```

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


More information about the flang-commits mailing list