[Mlir-commits] [mlir] e53494c - [mlir] Fix 0 values passed to the wrong parameters.

Adrian Kuegel llvmlistbot at llvm.org
Fri Jan 3 05:11:42 PST 2025


Author: Adrian Kuegel
Date: 2025-01-03T13:07:49Z
New Revision: e53494c750246118c313b3cbf7479edb682f2208

URL: https://github.com/llvm/llvm-project/commit/e53494c750246118c313b3cbf7479edb682f2208
DIFF: https://github.com/llvm/llvm-project/commit/e53494c750246118c313b3cbf7479edb682f2208.diff

LOG: [mlir] Fix 0 values passed to the wrong parameters.

This was found by modernize-use-nullptr ClangTidy check, which suggested
to pass nullptr instead of 0 to DIFileAttr.
However it looks like the intention was to pass the two 0 values for
line and scopeLine, and we should pass {} to DIFileAttr. Do that change.

Added: 
    

Modified: 
    mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
index 28e8b81a055768..7490e8735f5fd7 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
@@ -233,7 +233,7 @@ DIRecursiveTypeAttrInterface DISubprogramAttr::withRecId(DistinctAttr recId) {
 
 DIRecursiveTypeAttrInterface DISubprogramAttr::getRecSelf(DistinctAttr recId) {
   return DISubprogramAttr::get(recId.getContext(), recId, /*isRecSelf=*/true,
-                               {}, {}, {}, {}, {}, 0, 0, {}, {}, {}, {}, {});
+                               {}, {}, {}, {}, {}, {}, 0, 0, {}, {}, {}, {});
 }
 
 //===----------------------------------------------------------------------===//


        


More information about the Mlir-commits mailing list