Update clang to r339409b.
Change-Id: Ied8a188bb072c40035320acedc86164b66d920af
diff --git a/linux-x64/clang/include/llvm/Support/GenericDomTree.h b/linux-x64/clang/include/llvm/Support/GenericDomTree.h
index c716e4a..b3018ba 100644
--- a/linux-x64/clang/include/llvm/Support/GenericDomTree.h
+++ b/linux-x64/clang/include/llvm/Support/GenericDomTree.h
@@ -24,6 +24,14 @@
#ifndef LLVM_SUPPORT_GENERICDOMTREE_H
#define LLVM_SUPPORT_GENERICDOMTREE_H
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/GraphTraits.h"
+#include "llvm/ADT/PointerIntPair.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/CFGUpdate.h"
+#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
@@ -32,13 +40,6 @@
#include <type_traits>
#include <utility>
#include <vector>
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/PointerIntPair.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/raw_ostream.h"
namespace llvm {
@@ -192,6 +193,10 @@
void Calculate(DomTreeT &DT);
template <typename DomTreeT>
+void CalculateWithUpdates(DomTreeT &DT,
+ ArrayRef<typename DomTreeT::UpdateType> Updates);
+
+template <typename DomTreeT>
void InsertEdge(DomTreeT &DT, typename DomTreeT::NodePtr From,
typename DomTreeT::NodePtr To);
@@ -199,36 +204,6 @@
void DeleteEdge(DomTreeT &DT, typename DomTreeT::NodePtr From,
typename DomTreeT::NodePtr To);
-// UpdateKind and Update are used by the batch update API and it's easiest to
-// define them here.
-enum class UpdateKind : unsigned char { Insert, Delete };
-
-template <typename NodePtr>
-struct Update {
- using NodeKindPair = PointerIntPair<NodePtr, 1, UpdateKind>;
-
- NodePtr From;
- NodeKindPair ToAndKind;
-
- Update(UpdateKind Kind, NodePtr From, NodePtr To)
- : From(From), ToAndKind(To, Kind) {}
-
- UpdateKind getKind() const { return ToAndKind.getInt(); }
- NodePtr getFrom() const { return From; }
- NodePtr getTo() const { return ToAndKind.getPointer(); }
- bool operator==(const Update &RHS) const {
- return From == RHS.From && ToAndKind == RHS.ToAndKind;
- }
-
- friend raw_ostream &operator<<(raw_ostream &OS, const Update &U) {
- OS << (U.getKind() == UpdateKind::Insert ? "Insert " : "Delete ");
- U.getFrom()->printAsOperand(OS, false);
- OS << " -> ";
- U.getTo()->printAsOperand(OS, false);
- return OS;
- }
-};
-
template <typename DomTreeT>
void ApplyUpdates(DomTreeT &DT,
ArrayRef<typename DomTreeT::UpdateType> Updates);
@@ -254,8 +229,8 @@
using ParentType = typename std::remove_pointer<ParentPtr>::type;
static constexpr bool IsPostDominator = IsPostDom;
- using UpdateType = DomTreeBuilder::Update<NodePtr>;
- using UpdateKind = DomTreeBuilder::UpdateKind;
+ using UpdateType = cfg::Update<NodePtr>;
+ using UpdateKind = cfg::UpdateKind;
static constexpr UpdateKind Insert = UpdateKind::Insert;
static constexpr UpdateKind Delete = UpdateKind::Delete;
@@ -759,6 +734,11 @@
DomTreeBuilder::Calculate(*this);
}
+ void recalculate(ParentType &Func, ArrayRef<UpdateType> Updates) {
+ Parent = &Func;
+ DomTreeBuilder::CalculateWithUpdates(*this, Updates);
+ }
+
/// verify - checks if the tree is correct. There are 3 level of verification:
/// - Full -- verifies if the tree is correct by making sure all the
/// properties (including the parent and the sibling property)