[Lldb-commits] [lldb] a36f316 - Forward declare Optional<T> in STLExtras.h
Reid Kleckner via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 13 16:35:46 PST 2019
Author: Reid Kleckner
Date: 2019-11-13T16:34:00-08:00
New Revision: a36f316390d4bc1bcb0e9de0f55831385ab24099
URL: https://github.com/llvm/llvm-project/commit/a36f316390d4bc1bcb0e9de0f55831385ab24099
DIFF: https://github.com/llvm/llvm-project/commit/a36f316390d4bc1bcb0e9de0f55831385ab24099.diff
LOG: Forward declare Optional<T> in STLExtras.h
WIP stats
Added:
Modified:
lldb/include/lldb/Utility/UserIDResolver.h
llvm/include/llvm/ADT/STLExtras.h
llvm/include/llvm/ADT/StringSwitch.h
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
llvm/include/llvm/Support/CachePruning.h
llvm/include/llvm/Support/Error.h
llvm/include/llvm/Support/Format.h
llvm/include/llvm/Support/Threading.h
llvm/lib/MC/MCInstrAnalysis.cpp
llvm/lib/Support/CrashRecoveryContext.cpp
llvm/lib/Support/DJB.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Utility/UserIDResolver.h b/lldb/include/lldb/Utility/UserIDResolver.h
index bca82a11b660..60f3982f573d 100644
--- a/lldb/include/lldb/Utility/UserIDResolver.h
+++ b/lldb/include/lldb/Utility/UserIDResolver.h
@@ -10,6 +10,7 @@
#define LLDB_UTILITY_USERIDRESOLVER_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include <mutex>
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 274933bc5204..c3b704c3fd79 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -16,8 +16,6 @@
#ifndef LLVM_ADT_STLEXTRAS_H
#define LLVM_ADT_STLEXTRAS_H
-#include "llvm/ADT/Optional.h"
-#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Config/abi-breaking.h"
@@ -42,6 +40,9 @@
namespace llvm {
+template <typename T> class Optional;
+template <typename T, unsigned N> class SmallVector;
+
// Only used by compiler if both template types are the same. Useful when
// using SFINAE to test for the existence of member functions.
template <typename T, T> struct SameType;
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index fea911f6928b..d2a657ecbbee 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -12,6 +12,7 @@
#ifndef LLVM_ADT_STRINGSWITCH_H
#define LLVM_ADT_STRINGSWITCH_H
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include <cassert>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index c6539df0d756..5edf92a95f84 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -10,9 +10,10 @@
#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/iterator.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Triple.h"
+#include "llvm/ADT/iterator.h"
#include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
#include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index a72a86439f6a..297aa6d1ab8b 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_CACHE_PRUNING_H
#define LLVM_SUPPORT_CACHE_PRUNING_H
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/StringRef.h"
#include <chrono>
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h
index 350877a219bf..01bfc4a5fb5f 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -14,6 +14,7 @@
#define LLVM_SUPPORT_ERROR_H
#include "llvm-c/Error.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
diff --git a/llvm/include/llvm/Support/Format.h b/llvm/include/llvm/Support/Format.h
index 9dd7b401b46a..3f5251ca8d24 100644
--- a/llvm/include/llvm/Support/Format.h
+++ b/llvm/include/llvm/Support/Format.h
@@ -23,6 +23,7 @@
#define LLVM_SUPPORT_FORMAT_H
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
diff --git a/llvm/include/llvm/Support/Threading.h b/llvm/include/llvm/Support/Threading.h
index bacab8fa23b6..f53c116f0d44 100644
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -15,6 +15,7 @@
#define LLVM_SUPPORT_THREADING_H
#include "llvm/ADT/FunctionExtras.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
#include "llvm/Support/Compiler.h"
diff --git a/llvm/lib/MC/MCInstrAnalysis.cpp b/llvm/lib/MC/MCInstrAnalysis.cpp
index 54741fdd686d..5e0c09f49fbe 100644
--- a/llvm/lib/MC/MCInstrAnalysis.cpp
+++ b/llvm/lib/MC/MCInstrAnalysis.cpp
@@ -7,8 +7,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/MC/MCInstrAnalysis.h"
-
#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp
index a9e0fcc73b9a..4af627e3254f 100644
--- a/llvm/lib/Support/CrashRecoveryContext.cpp
+++ b/llvm/lib/Support/CrashRecoveryContext.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CrashRecoveryContext.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
diff --git a/llvm/lib/Support/DJB.cpp b/llvm/lib/Support/DJB.cpp
index f06af7dfde44..d4f68ff8ae24 100644
--- a/llvm/lib/Support/DJB.cpp
+++ b/llvm/lib/Support/DJB.cpp
@@ -12,6 +12,7 @@
#include "llvm/Support/DJB.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/Optional.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Unicode.h"
More information about the lldb-commits
mailing list