1 //===-- GuardUtils.h - Utils for work with guards ---------------*- C++ -*-===// 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 // Utils that are used to perform transformations related to guards and their 10 // conditions. 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_TRANSFORMS_UTILS_GUARDUTILS_H 14 #define LLVM_TRANSFORMS_UTILS_GUARDUTILS_H 15 16 namespace llvm { 17 18 class CallInst; 19 class Function; 20 21 /// Splits control flow at point of \p Guard, replacing it with explicit branch 22 /// by the condition of guard's first argument. The taken branch then goes to 23 /// the block that contains \p Guard's successors, and the non-taken branch 24 /// goes to a newly-created deopt block that contains a sole call of the 25 /// deoptimize function \p DeoptIntrinsic. 26 void makeGuardControlFlowExplicit(Function *DeoptIntrinsic, CallInst *Guard); 27 28 } // llvm 29 30 #endif // LLVM_TRANSFORMS_UTILS_GUARDUTILS_H 31