[llvm] [llvm/IR] Fix module build issue following e57308b063bb (NFC) (PR #94580)

Med Ismail Bennani via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 23:01:36 PDT 2024


https://github.com/medismailben created https://github.com/llvm/llvm-project/pull/94580

This patch fixes a build issue following e57308b063bb when enabling module build (`-DLLVM_ENABLE_MODULES=On`).

With that change, we failed to build the LLVM_IR module since `GEPNoWrapFlags` wasn't defined prior to using it.

This patch addresses that issue by including the right header in `llvm/IR/Constant.h` which is also included by most headers in the LLVM_IR module. This should ensure that we can always build it.

>From 85bdbcf3782c1b32ac93234b5e77c499523f01f1 Mon Sep 17 00:00:00 2001
From: Med Ismail Bennani <ismail at bennani.ma>
Date: Wed, 5 Jun 2024 21:29:18 -0700
Subject: [PATCH] [llvm/IR] Fix module build issue following e57308b063bb (NFC)

This patch fixes a build issue following e57308b063bb when enabling
module build.

With that change, we failed to build the LLVM_IR module since
GEPNoWrapFlags wasn't defined prior to using it.

This patch addressed that issue by including the right header in
`llvm/IR/Constant.h` which is also included by most headers in the
LLVM_IR module. This should ensure that we can always build it.

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
---
 llvm/include/llvm/IR/Constant.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/IR/Constant.h b/llvm/include/llvm/IR/Constant.h
index d3171acf7b9ac..12a6211e505bd 100644
--- a/llvm/include/llvm/IR/Constant.h
+++ b/llvm/include/llvm/IR/Constant.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_IR_CONSTANT_H
 #define LLVM_IR_CONSTANT_H
 
+#include "llvm/IR/GEPNoWrapFlags.h"
 #include "llvm/IR/User.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"



More information about the llvm-commits mailing list