[llvm-branch-commits] [flang] [mlir] [flang][OpenMP][NFC] remove globals with mlir::StateStack (PR #144898)

Sergio Afonso via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jun 19 08:57:14 PDT 2025


================
@@ -1818,16 +1852,17 @@ static void genTargetClauses(
     llvm::SmallVectorImpl<const semantics::Symbol *> &hasDeviceAddrSyms,
     llvm::SmallVectorImpl<const semantics::Symbol *> &isDevicePtrSyms,
     llvm::SmallVectorImpl<const semantics::Symbol *> &mapSyms) {
+  HostEvalInfo *hostEvalInfo = getHostEvalInfoStackTop(converter);
   ClauseProcessor cp(converter, semaCtx, clauses);
   cp.processBare(clauseOps);
   cp.processDefaultMap(stmtCtx, defaultMaps);
   cp.processDepend(symTable, stmtCtx, clauseOps);
   cp.processDevice(stmtCtx, clauseOps);
   cp.processHasDeviceAddr(stmtCtx, clauseOps, hasDeviceAddrSyms);
-  if (!hostEvalInfo.empty()) {
+  if (hostEvalInfo) {
----------------
skatrak wrote:

Nit: For consistency with `genBodyOfTargetOp`, and general conciseness
```suggestion
  if (HostEvalInfo *hostEvalInfo = getHostEvalInfoStackTop(converter)) {
```

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


More information about the llvm-branch-commits mailing list