Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Support/GenericDomTreeConstruction.h
Show All 36 Lines | |||||
#ifndef LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H | #ifndef LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H | ||||
#define LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H | #define LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H | ||||
#include "llvm/ADT/ArrayRef.h" | #include "llvm/ADT/ArrayRef.h" | ||||
#include "llvm/ADT/DenseSet.h" | #include "llvm/ADT/DenseSet.h" | ||||
#include "llvm/ADT/DepthFirstIterator.h" | #include "llvm/ADT/DepthFirstIterator.h" | ||||
#include "llvm/ADT/PointerIntPair.h" | #include "llvm/ADT/PointerIntPair.h" | ||||
#include "llvm/ADT/SmallPtrSet.h" | #include "llvm/ADT/SmallPtrSet.h" | ||||
#include "llvm/IR/Function.h" | |||||
#include "llvm/Support/Casting.h" | |||||
#include "llvm/Support/Debug.h" | #include "llvm/Support/Debug.h" | ||||
#include "llvm/Support/GenericDomTree.h" | #include "llvm/Support/GenericDomTree.h" | ||||
#include <queue> | #include <queue> | ||||
#define DEBUG_TYPE "dom-tree-builder" | #define DEBUG_TYPE "dom-tree-builder" | ||||
namespace llvm { | namespace llvm { | ||||
namespace DomTreeBuilder { | namespace DomTreeBuilder { | ||||
▲ Show 20 Lines • Show All 470 Lines • ▼ Show 20 Lines | void doFullDFSWalk(const DomTreeT &DT, DescendCondition DC) { | ||||
unsigned Num = 1; | unsigned Num = 1; | ||||
for (const NodePtr Root : DT.Roots) Num = runDFS(Root, Num, DC, 0); | for (const NodePtr Root : DT.Roots) Num = runDFS(Root, Num, DC, 0); | ||||
} | } | ||||
static void CalculateFromScratch(DomTreeT &DT, BatchUpdatePtr BUI) { | static void CalculateFromScratch(DomTreeT &DT, BatchUpdatePtr BUI) { | ||||
auto *Parent = DT.Parent; | auto *Parent = DT.Parent; | ||||
DT.reset(); | DT.reset(); | ||||
DT.Parent = Parent; | DT.Parent = Parent; | ||||
if constexpr (std::is_same< | |||||
Lint: Pre-merge checks: clang-tidy: warning: constexpr if is a C++17 extension [clang-diagnostic-c++17-extensions]… | |||||
MaskRayUnsubmitted Not Done ReplyInline Actionsllvm-project currently requires C++14. C++17 extensions can't be used. (As an exception, if init-statement is allowed) MaskRay: llvm-project currently requires C++14. C++17 extensions can't be used. (As an exception, if… | |||||
Function *, | |||||
typename std::remove_const< | |||||
typename DomTreeT::ParentPtr>::type>::value) { | |||||
if (auto *F = dyn_cast<Function>(DT.Parent)) | |||||
if (F->empty()) | |||||
return; | |||||
} | |||||
SemiNCAInfo SNCA(nullptr); // Since we are rebuilding the whole tree, | SemiNCAInfo SNCA(nullptr); // Since we are rebuilding the whole tree, | ||||
// there's no point doing it incrementally. | // there's no point doing it incrementally. | ||||
// Step #0: Number blocks in depth-first order and initialize variables used | // Step #0: Number blocks in depth-first order and initialize variables used | ||||
// in later stages of the algorithm. | // in later stages of the algorithm. | ||||
DT.Roots = FindRoots(DT, nullptr); | DT.Roots = FindRoots(DT, nullptr); | ||||
SNCA.doFullDFSWalk(DT, AlwaysDescend); | SNCA.doFullDFSWalk(DT, AlwaysDescend); | ||||
▲ Show 20 Lines • Show All 1,040 Lines • Show Last 20 Lines |
clang-tidy: warning: constexpr if is a C++17 extension [clang-diagnostic-c++17-extensions]
not useful