[Mlir-commits] [mlir] [MLIR] Improve translation of DISubrange. (PR #93689)

Abid Qadeer llvmlistbot at llvm.org
Thu May 30 04:30:09 PDT 2024


================
@@ -314,11 +314,24 @@ llvm::DINamespace *DebugTranslation::translateImpl(DINamespaceAttr attr) {
 }
 
 llvm::DISubrange *DebugTranslation::translateImpl(DISubrangeAttr attr) {
-  auto getMetadataOrNull = [&](IntegerAttr attr) -> llvm::Metadata * {
+  auto getMetadataOrNull = [&](Attribute attr) -> llvm::Metadata * {
     if (!attr)
       return nullptr;
-    return llvm::ConstantAsMetadata::get(llvm::ConstantInt::getSigned(
-        llvm::Type::getInt64Ty(llvmCtx), attr.getInt()));
+
+    if (auto intAttr = llvm::dyn_cast<IntegerAttr>(attr)) {
----------------
abidh wrote:

Done.

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


More information about the Mlir-commits mailing list