From fd0375bf86c838aa20095f2e5d14dca03422d00b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 1 Nov 2001 07:00:21 +0000 Subject: [PATCH] Expose the low level DCE mechanism to external users git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1082 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Transforms/Scalar/DCE.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/llvm/Transforms/Scalar/DCE.h b/include/llvm/Transforms/Scalar/DCE.h index e7a07ec8968..09ab61c3228 100644 --- a/include/llvm/Transforms/Scalar/DCE.h +++ b/include/llvm/Transforms/Scalar/DCE.h @@ -9,6 +9,7 @@ #define LLVM_OPT_DCE_H #include "llvm/Pass.h" +#include "llvm/BasicBlock.h" namespace opt { @@ -17,6 +18,14 @@ struct DeadCodeElimination : public Pass { // static bool doDCE(Method *M); + // dceInstruction - Inspect the instruction at *BBI and figure out if it's + // [trivially] dead. If so, remove the instruction and update the iterator + // to point to the instruction that immediately succeeded the original + // instruction. + // + static bool dceInstruction(BasicBlock::InstListType &BBIL, + BasicBlock::iterator &BBI); + // Remove unused global values - This removes unused global values of no // possible value. This currently includes unused method prototypes and // unitialized global variables.