From eb812efa12fb82ca338794fa18b610ca9581aef5 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger <joerg@bec.de> Date: Mon, 2 Mar 2020 18:24:11 +0100 Subject: [PATCH] Explicitly include <cassert> when using assert Depending on the OS used, a module-enabled build can fail due to the special handling <cassert> gets as textual header. --- clang/lib/AST/CommentCommandTraits.cpp | 1 + llvm/lib/Support/APSInt.cpp | 1 + llvm/lib/Support/FormatVariadic.cpp | 1 + llvm/lib/Support/IntEqClasses.cpp | 1 + llvm/lib/Support/IntervalMap.cpp | 1 + llvm/lib/Support/KnownBits.cpp | 1 + llvm/lib/Support/PrettyStackTrace.cpp | 1 + llvm/lib/Support/Regex.cpp | 1 + llvm/lib/Support/StringPool.cpp | 1 + llvm/lib/Support/Triple.cpp | 1 + llvm/lib/Support/VersionTuple.cpp | 1 + llvm/lib/TableGen/TableGenBackend.cpp | 1 + llvm/lib/Target/AArch64/AArch64StackOffset.h | 1 + llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp | 1 + llvm/utils/TableGen/CodeGenHwModes.h | 1 + llvm/utils/TableGen/CodeGenInstruction.h | 1 + 16 files changed, 16 insertions(+) diff --git a/clang/lib/AST/CommentCommandTraits.cpp b/clang/lib/AST/CommentCommandTraits.cpp index b306fcbb154f..bdc0dd47fb7d 100644 --- a/clang/lib/AST/CommentCommandTraits.cpp +++ b/clang/lib/AST/CommentCommandTraits.cpp @@ -8,6 +8,7 @@ #include "clang/AST/CommentCommandTraits.h" #include "llvm/ADT/STLExtras.h" +#include <cassert> namespace clang { namespace comments { diff --git a/llvm/lib/Support/APSInt.cpp b/llvm/lib/Support/APSInt.cpp index 7c48880f96ea..6805e06df333 100644 --- a/llvm/lib/Support/APSInt.cpp +++ b/llvm/lib/Support/APSInt.cpp @@ -14,6 +14,7 @@ #include "llvm/ADT/APSInt.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringRef.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/Support/FormatVariadic.cpp b/llvm/lib/Support/FormatVariadic.cpp index f9e89f69b528..0d61fae22323 100644 --- a/llvm/lib/Support/FormatVariadic.cpp +++ b/llvm/lib/Support/FormatVariadic.cpp @@ -6,6 +6,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/FormatVariadic.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/Support/IntEqClasses.cpp b/llvm/lib/Support/IntEqClasses.cpp index 4a976dcefc65..ebb02e6c01e5 100644 --- a/llvm/lib/Support/IntEqClasses.cpp +++ b/llvm/lib/Support/IntEqClasses.cpp @@ -18,6 +18,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/IntEqClasses.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/Support/IntervalMap.cpp b/llvm/lib/Support/IntervalMap.cpp index f15c7c9403c3..674e0f962fa1 100644 --- a/llvm/lib/Support/IntervalMap.cpp +++ b/llvm/lib/Support/IntervalMap.cpp @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/IntervalMap.h" +#include <cassert> namespace llvm { namespace IntervalMapImpl { diff --git a/llvm/lib/Support/KnownBits.cpp b/llvm/lib/Support/KnownBits.cpp index 8f3f4aa8caea..2f1cff7914bc 100644 --- a/llvm/lib/Support/KnownBits.cpp +++ b/llvm/lib/Support/KnownBits.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/KnownBits.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp index bfb238cc8539..30a12f65966a 100644 --- a/llvm/lib/Support/PrettyStackTrace.cpp +++ b/llvm/lib/Support/PrettyStackTrace.cpp @@ -22,6 +22,7 @@ #include "llvm/Support/raw_ostream.h" #include <atomic> +#include <cassert> #include <cstdarg> #include <cstdio> #include <tuple> diff --git a/llvm/lib/Support/Regex.cpp b/llvm/lib/Support/Regex.cpp index 615e48a5df7e..f065adadc62b 100644 --- a/llvm/lib/Support/Regex.cpp +++ b/llvm/lib/Support/Regex.cpp @@ -14,6 +14,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" +#include <cassert> #include <string> // Important this comes last because it defines "_REGEX_H_". At least on diff --git a/llvm/lib/Support/StringPool.cpp b/llvm/lib/Support/StringPool.cpp index 82351017b8cc..274644445389 100644 --- a/llvm/lib/Support/StringPool.cpp +++ b/llvm/lib/Support/StringPool.cpp @@ -12,6 +12,7 @@ #include "llvm/Support/StringPool.h" #include "llvm/ADT/StringRef.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index e09abd24eb5b..79f31efefb78 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/Host.h" #include "llvm/Support/SwapByteOrder.h" #include "llvm/Support/TargetParser.h" +#include <cassert> #include <cstring> using namespace llvm; diff --git a/llvm/lib/Support/VersionTuple.cpp b/llvm/lib/Support/VersionTuple.cpp index 60b59424fbb4..e8265c0d41bb 100644 --- a/llvm/lib/Support/VersionTuple.cpp +++ b/llvm/lib/Support/VersionTuple.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/VersionTuple.h" #include "llvm/Support/raw_ostream.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/TableGen/TableGenBackend.cpp b/llvm/lib/TableGen/TableGenBackend.cpp index e11b28e8cff9..252f126d2d00 100644 --- a/llvm/lib/TableGen/TableGenBackend.cpp +++ b/llvm/lib/TableGen/TableGenBackend.cpp @@ -13,6 +13,7 @@ #include "llvm/TableGen/TableGenBackend.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/raw_ostream.h" +#include <cassert> using namespace llvm; diff --git a/llvm/lib/Target/AArch64/AArch64StackOffset.h b/llvm/lib/Target/AArch64/AArch64StackOffset.h index f95b5dc5246e..6fa1c744f77e 100644 --- a/llvm/lib/Target/AArch64/AArch64StackOffset.h +++ b/llvm/lib/Target/AArch64/AArch64StackOffset.h @@ -16,6 +16,7 @@ #include "llvm/Support/MachineValueType.h" #include "llvm/Support/TypeSize.h" +#include <cassert> namespace llvm { diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp index 8c7b8a81889e..af1451cc4704 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp @@ -12,6 +12,7 @@ #include "PPCMCAsmInfo.h" #include "llvm/ADT/Triple.h" +#include <cassert> using namespace llvm; diff --git a/llvm/utils/TableGen/CodeGenHwModes.h b/llvm/utils/TableGen/CodeGenHwModes.h index 1ff2faaa0e52..55507cbca37d 100644 --- a/llvm/utils/TableGen/CodeGenHwModes.h +++ b/llvm/utils/TableGen/CodeGenHwModes.h @@ -12,6 +12,7 @@ #define LLVM_UTILS_TABLEGEN_CODEGENHWMODES_H #include "llvm/ADT/StringMap.h" +#include <cassert> #include <map> #include <string> #include <vector> diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h index 1f08ce481a89..af851a11676b 100644 --- a/llvm/utils/TableGen/CodeGenInstruction.h +++ b/llvm/utils/TableGen/CodeGenInstruction.h @@ -16,6 +16,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/MachineValueType.h" #include "llvm/Support/SMLoc.h" +#include <cassert> #include <string> #include <utility> #include <vector>