2
0

PostDominators.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //===- PostDominators.cpp - Post-Dominator Calculation --------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file implements the post-dominator construction algorithms.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/Analysis/PostDominators.h"
  14. #include "llvm/ADT/DepthFirstIterator.h"
  15. #include "llvm/ADT/SetOperations.h"
  16. #include "llvm/IR/CFG.h"
  17. #include "llvm/IR/Instructions.h"
  18. #include "llvm/Support/Debug.h"
  19. #include "llvm/Support/GenericDomTreeConstruction.h"
  20. using namespace llvm;
  21. #define DEBUG_TYPE "postdomtree"
  22. //===----------------------------------------------------------------------===//
  23. // PostDominatorTree Implementation
  24. //===----------------------------------------------------------------------===//
  25. char PostDominatorTree::ID = 0;
  26. INITIALIZE_PASS(PostDominatorTree, "postdomtree",
  27. "Post-Dominator Tree Construction", true, true)
  28. bool PostDominatorTree::runOnFunction(Function &F) {
  29. DT->recalculate(F);
  30. return false;
  31. }
  32. PostDominatorTree::~PostDominatorTree() {
  33. delete DT;
  34. }
  35. void PostDominatorTree::print(raw_ostream &OS, const Module *) const {
  36. DT->print(OS);
  37. }
  38. FunctionPass* llvm::createPostDomTree() {
  39. return new PostDominatorTree();
  40. }