diff --git a/lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp b/lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp index 12ec2d61c..4ed92b85b 100644 --- a/lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp +++ b/lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp @@ -17,7 +17,7 @@ using namespace mlir; StringRef mlir::torch::Torch::getAbstractInterpLibrary() { -#ifndef _MSC_VER +#if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Woverlength-strings" #endif @@ -10984,7 +10984,7 @@ StringRef mlir::torch::Torch::getAbstractInterpLibrary() { "}\n" ""; // clang-format on -#ifndef _MSC_VER +#if defined(__clang__) #pragma clang diagnostic pop #endif } diff --git a/python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/abstract_interp_lib_gen.py b/python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/abstract_interp_lib_gen.py index 837058533..6c1d59f25 100644 --- a/python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/abstract_interp_lib_gen.py +++ b/python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/abstract_interp_lib_gen.py @@ -3563,14 +3563,14 @@ f"""//===-------------------------------------------------------------*- C++-*-= using namespace mlir; StringRef mlir::torch::Torch::getAbstractInterpLibrary() {{ -#ifndef _MSC_VER +#if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Woverlength-strings" #endif // clang-format off return {asm}; // clang-format on -#ifndef _MSC_VER +#if defined(__clang__) #pragma clang diagnostic pop #endif }}""")