[llvm-branch-commits] [mlir] a555ca8 - Workaround around clang 5.0 bug by including SmallVector.h in LLVM.h (PR41549)

Mehdi Amini via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 17 16:05:38 PST 2020


Author: Mehdi Amini
Date: 2020-12-18T00:00:36Z
New Revision: a555ca8b3d67267c19db48fc2470d20daae80aeb

URL: https://github.com/llvm/llvm-project/commit/a555ca8b3d67267c19db48fc2470d20daae80aeb
DIFF: https://github.com/llvm/llvm-project/commit/a555ca8b3d67267c19db48fc2470d20daae80aeb.diff

LOG: 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

Added: 
    

Modified: 
    mlir/include/mlir/Support/LLVM.h

Removed: 
    


################################################################################
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


        


More information about the llvm-branch-commits mailing list