Properly guard clang-specific pragma.

Avoids unsupported pragma warning on GCC.
pull/2441/head
Stella Laurenzo 2023-09-06 00:43:50 -07:00
parent 29fdc3833c
commit fcb3b718a5
2 changed files with 4 additions and 4 deletions

View File

@ -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
}

View File

@ -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
}}""")