LLVM  mainline
InstCombine.h
Go to the documentation of this file.
00001 //===- InstCombine.h - InstCombine pass -------------------------*- C++ -*-===//
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 /// \file
00010 ///
00011 /// This file provides the primary interface to the instcombine pass. This pass
00012 /// is suitable for use in the new pass manager. For a pass that works with the
00013 /// legacy pass manager, please look for \c createInstructionCombiningPass() in
00014 /// Scalar.h.
00015 ///
00016 //===----------------------------------------------------------------------===//
00017 
00018 #ifndef LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINE_H
00019 #define LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINE_H
00020 
00021 #include "llvm/IR/Function.h"
00022 #include "llvm/IR/PassManager.h"
00023 #include "llvm/Transforms/InstCombine/InstCombineWorklist.h"
00024 
00025 namespace llvm {
00026 
00027 class InstCombinePass {
00028   InstCombineWorklist Worklist;
00029 
00030 public:
00031   static StringRef name() { return "InstCombinePass"; }
00032 
00033   // Explicitly define constructors for MSVC.
00034   InstCombinePass() {}
00035   InstCombinePass(InstCombinePass &&Arg) : Worklist(std::move(Arg.Worklist)) {}
00036   InstCombinePass &operator=(InstCombinePass &&RHS) {
00037     Worklist = std::move(RHS.Worklist);
00038     return *this;
00039   }
00040 
00041   PreservedAnalyses run(Function &F, AnalysisManager<Function> *AM);
00042 };
00043 
00044 }
00045 
00046 #endif