LLVM API Documentation

PostDominators.cpp
Go to the documentation of this file.
00001 //===- PostDominators.cpp - Post-Dominator Calculation --------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the post-dominator construction algorithms.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "llvm/Analysis/PostDominators.h"
00015 #include "llvm/ADT/DepthFirstIterator.h"
00016 #include "llvm/ADT/SetOperations.h"
00017 #include "llvm/IR/CFG.h"
00018 #include "llvm/IR/Instructions.h"
00019 #include "llvm/Support/Debug.h"
00020 #include "llvm/Support/GenericDomTreeConstruction.h"
00021 using namespace llvm;
00022 
00023 #define DEBUG_TYPE "postdomtree"
00024 
00025 //===----------------------------------------------------------------------===//
00026 //  PostDominatorTree Implementation
00027 //===----------------------------------------------------------------------===//
00028 
00029 char PostDominatorTree::ID = 0;
00030 INITIALIZE_PASS(PostDominatorTree, "postdomtree",
00031                 "Post-Dominator Tree Construction", true, true)
00032 
00033 bool PostDominatorTree::runOnFunction(Function &F) {
00034   DT->recalculate(F);
00035   return false;
00036 }
00037 
00038 PostDominatorTree::~PostDominatorTree() {
00039   delete DT;
00040 }
00041 
00042 void PostDominatorTree::print(raw_ostream &OS, const Module *) const {
00043   DT->print(OS);
00044 }
00045 
00046 
00047 FunctionPass* llvm::createPostDomTree() {
00048   return new PostDominatorTree();
00049 }
00050