[llvm] [mlir] [mlir][nvvm] Add missing include to llvm-config.h. (PR #83998)

Ingo Müller via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 04:02:03 PST 2024


https://github.com/ingomueller-net created https://github.com/llvm/llvm-project/pull/83998

This is another follow-up of #83004. `NVVM/Target.cpp` uses the macro `MLIR_NVPTXCOMPILER_ENABLED`, which is defined in `llvm-config.h` but did not include that file, yielding a warning when compiled with `-Wundef`. This PR adds the include.

>From bb6858e0097badabb146f34e65c29180d7a54722 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20M=C3=BCller?= <ingomueller at google.com>
Date: Tue, 5 Mar 2024 10:14:00 +0000
Subject: [PATCH] [mlir][nvvm] Add missing include to llvm-config.h.

`NVVM/Target.cpp` uses the macro `MLIR_NVPTXCOMPILER_ENABLED`, which is
defined in `llvm-config.h` but did not include that file, yielding a
warning when compiled with `-Wundef`. This PR adds the include.
---
 mlir/lib/Target/LLVM/NVVM/Target.cpp              | 1 +
 utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 1 +
 2 files changed, 2 insertions(+)

diff --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index d5b6645631edd6..e31df99ea20d6f 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -22,6 +22,7 @@
 #include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
 #include "mlir/Target/LLVMIR/Export.h"
 
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 8a8dd6e10c48aa..e917d310415f35 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -6182,6 +6182,7 @@ cc_library(
         ":config",
         "//llvm:NVPTXCodeGen",
         "//llvm:Support",
+        "//llvm:config",
     ],
 )
 



More information about the llvm-commits mailing list