projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fall back to the selection dag isel to select tail calls.
[oota-llvm.git]
/
include
/
llvm
/
CodeGen
/
MachineDominators.h
diff --git
a/include/llvm/CodeGen/MachineDominators.h
b/include/llvm/CodeGen/MachineDominators.h
index 44bbaa0fbe66bfdc572c57e6514deb52c43d88ee..40b2542fd6f5dcbe04fddd82a7e4712b705af8a9 100644
(file)
--- a/
include/llvm/CodeGen/MachineDominators.h
+++ b/
include/llvm/CodeGen/MachineDominators.h
@@
-2,8
+2,8
@@
//
// The LLVM Compiler Infrastructure
//
//
// The LLVM Compiler Infrastructure
//
-// This file
was developed by Owen Anderson and is distributed under
-//
the University of Illinois Open Source
License. See LICENSE.TXT for details.
+// This file
is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
@@
-15,18
+15,14
@@
#ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H
#define LLVM_CODEGEN_MACHINEDOMINATORS_H
#ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H
#define LLVM_CODEGEN_MACHINEDOMINATORS_H
-#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Analysis/DominatorInternals.h"
+#include "llvm/Analysis/Dominators.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Analysis/DominatorInternals.h"
-#include "llvm/ADT/GraphTraits.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
namespace llvm {
namespace llvm {
-inline void WriteAsOperand(std::ostream &, const MachineBasicBlock*, bool t) { }
-
template<>
inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB) {
this->Roots.push_back(MBB);
template<>
inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB) {
this->Roots.push_back(MBB);
@@
-46,21
+42,13
@@
public:
static char ID; // Pass ID, replacement for typeid
DominatorTreeBase<MachineBasicBlock>* DT;
static char ID; // Pass ID, replacement for typeid
DominatorTreeBase<MachineBasicBlock>* DT;
- MachineDominatorTree() : MachineFunctionPass(intptr_t(&ID)) {
- DT = new DominatorTreeBase<MachineBasicBlock>(false);
- }
+ MachineDominatorTree();
- ~MachineDominatorTree() {
- DT->releaseMemory();
- delete DT;
- }
+ ~MachineDominatorTree();
DominatorTreeBase<MachineBasicBlock>& getBase() { return *DT; }
DominatorTreeBase<MachineBasicBlock>& getBase() { return *DT; }
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- MachineFunctionPass::getAnalysisUsage(AU);
- }
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const;
/// getRoots - Return the root blocks of the current CFG. This may include
/// multiple blocks if we are computing post dominators. For forward
/// getRoots - Return the root blocks of the current CFG. This may include
/// multiple blocks if we are computing post dominators. For forward
@@
-78,11
+66,7
@@
public:
return DT->getRootNode();
}
return DT->getRootNode();
}
- virtual bool runOnMachineFunction(MachineFunction &F) {
- DT->recalculate(F);
-
- return false;
- }
+ virtual bool runOnMachineFunction(MachineFunction &F);
inline bool dominates(MachineDomTreeNode* A, MachineDomTreeNode* B) const {
return DT->dominates(A, B);
inline bool dominates(MachineDomTreeNode* A, MachineDomTreeNode* B) const {
return DT->dominates(A, B);
@@
-100,7
+84,8
@@
public:
// Loop through the basic block until we find A or B.
MachineBasicBlock::iterator I = BBA->begin();
// Loop through the basic block until we find A or B.
MachineBasicBlock::iterator I = BBA->begin();
- for (; &*I != A && &*I != B; ++I) /*empty*/;
+ for (; &*I != A && &*I != B; ++I)
+ /*empty*/ ;
//if(!DT.IsPostDominators) {
// A dominates B if it is found first in the basic block.
//if(!DT.IsPostDominators) {
// A dominates B if it is found first in the basic block.
@@
-161,7
+146,7
@@
public:
}
/// eraseNode - Removes a node from the dominator tree. Block must not
}
/// eraseNode - Removes a node from the dominator tree. Block must not
- /// domi
an
te any other blocks. Removes node from its immediate dominator's
+ /// domi
na
te any other blocks. Removes node from its immediate dominator's
/// children list. Deletes dominator node associated with basic block BB.
inline void eraseNode(MachineBasicBlock *BB) {
DT->eraseNode(BB);
/// children list. Deletes dominator node associated with basic block BB.
inline void eraseNode(MachineBasicBlock *BB) {
DT->eraseNode(BB);
@@
-172,21
+157,25
@@
public:
inline void splitBlock(MachineBasicBlock* NewBB) {
DT->splitBlock(NewBB);
}
inline void splitBlock(MachineBasicBlock* NewBB) {
DT->splitBlock(NewBB);
}
-
-
- virtual void releaseMemory() {
- DT->releaseMemory();
+
+ /// isReachableFromEntry - Return true if A is dominated by the entry
+ /// block of the function containing it.
+ bool isReachableFromEntry(MachineBasicBlock *A) {
+ return DT->isReachableFromEntry(A);
}
}
+
+ virtual void releaseMemory();
- virtual void print(std::ostream &OS, const Module* M= 0) const {
- DT->print(OS, M);
- }
+ virtual void print(raw_ostream &OS, const Module*) const;
};
//===-------------------------------------
/// DominatorTree GraphTraits specialization so the DominatorTree can be
/// iterable by generic graph iterators.
///
};
//===-------------------------------------
/// DominatorTree GraphTraits specialization so the DominatorTree can be
/// iterable by generic graph iterators.
///
+
+template<class T> struct GraphTraits;
+
template <> struct GraphTraits<MachineDomTreeNode *> {
typedef MachineDomTreeNode NodeType;
typedef NodeType::iterator ChildIteratorType;
template <> struct GraphTraits<MachineDomTreeNode *> {
typedef MachineDomTreeNode NodeType;
typedef NodeType::iterator ChildIteratorType;