From a555ca8b3d67267c19db48fc2470d20daae80aeb Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 17 Dec 2020 23:53:19 +0000 Subject: [PATCH] Workaround around clang 5.0 bug by including SmallVector.h in LLVM.h (PR41549) The forward declaration for SmallVector does not play well with clang-5. Differential Revision: https://reviews.llvm.org/D93498 --- mlir/include/mlir/Support/LLVM.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mlir/include/mlir/Support/LLVM.h b/mlir/include/mlir/Support/LLVM.h index e8595ae29ed7..ced7a7a35363 100644 --- a/mlir/include/mlir/Support/LLVM.h +++ b/mlir/include/mlir/Support/LLVM.h @@ -23,6 +23,13 @@ #include "llvm/ADT/None.h" #include "llvm/Support/Casting.h" +// Workaround for clang-5 (PR41549) +#if defined(__clang_major__) +#if __clang_major__ <= 5 +#include "llvm/ADT/SmallVector.h" +#endif +#endif + // Forward declarations. namespace llvm { // String types