<commit_before>//===-- DCE.h - Functions that perform Dead Code Elimination -----*- C++ -*--=//
//
// This family of functions is useful for performing dead code elimination of 
// various sorts.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_OPT_DCE_H
#define LLVM_OPT_DCE_H

#include "llvm/Pass.h"
#include "llvm/BasicBlock.h"

namespace opt {

struct DeadCodeElimination : public Pass {
  // External Interface:
  //
  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.
  //
  static bool RemoveUnusedGlobalValues(Module *M);

  // RemoveUnusedGlobalValuesAfterLink - This function is only to be used after
  // linking the application.  It removes global variables with initializers and
  // unreachable methods.  This should only be used after an application is
  // linked, when it is not possible for an external entity to make a global
  // value live again.
  //
  // static bool RemoveUnusedGlobalValuesAfterLink(Module *M); // TODO

  // Pass Interface...
  virtual bool doPassInitialization(Module *M) {
    return RemoveUnusedGlobalValues(M);
  }
  virtual bool doPerMethodWork(Method *M) { return doDCE(M); }
  virtual bool doPassFinalization(Module *M) {
    return RemoveUnusedGlobalValues(M);
  }
};



struct AgressiveDCE : public Pass {
  // DoADCE - Execute the Agressive Dead Code Elimination Algorithm
  //
  static bool doADCE(Method *M);                        // Defined in ADCE.cpp

  virtual bool doPerMethodWork(Method *M) {
    return doADCE(M);
  }
};



// SimplifyCFG - This function is used to do simplification of a CFG.  For
// example, it adjusts branches to branches to eliminate the extra hop, it
// eliminates unreachable basic blocks, and does other "peephole" optimization
// of the CFG.  It returns true if a modification was made, and returns an 
// iterator that designates the first element remaining after the block that
// was deleted.
//
// WARNING:  The entry node of a method may not be simplified.
//
bool SimplifyCFG(Method::iterator &BBIt);

}  // End namespace opt

#endif
<commit_msg>Remove unused method<commit_after>//===-- DCE.h - Functions that perform Dead Code Elimination -----*- C++ -*--=//
//
// This family of functions is useful for performing dead code elimination of 
// various sorts.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_OPT_DCE_H
#define LLVM_OPT_DCE_H

#include "llvm/Pass.h"
#include "llvm/BasicBlock.h"

namespace opt {

struct DeadCodeElimination : public Pass {
  // External Interface:
  //
  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.
  //
  static bool RemoveUnusedGlobalValues(Module *M);

  // Pass Interface...
  virtual bool doPassInitialization(Module *M) {
    return RemoveUnusedGlobalValues(M);
  }
  virtual bool doPerMethodWork(Method *M) { return doDCE(M); }
  virtual bool doPassFinalization(Module *M) {
    return RemoveUnusedGlobalValues(M);
  }
};



struct AgressiveDCE : public Pass {
  // DoADCE - Execute the Agressive Dead Code Elimination Algorithm
  //
  static bool doADCE(Method *M);                        // Defined in ADCE.cpp

  virtual bool doPerMethodWork(Method *M) {
    return doADCE(M);
  }
};


// SimplifyCFG - This function is used to do simplification of a CFG.  For
// example, it adjusts branches to branches to eliminate the extra hop, it
// eliminates unreachable basic blocks, and does other "peephole" optimization
// of the CFG.  It returns true if a modification was made, and returns an 
// iterator that designates the first element remaining after the block that
// was deleted.
//
// WARNING:  The entry node of a method may not be simplified.
//
bool SimplifyCFG(Method::iterator &BBIt);

}  // End namespace opt

#endif

{'fraction_non_alphanumeric': 0.12040479140850888, 'fraction_numerical': 0.0, 'mean_word_length': 2.765940902021773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3851730', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1320, 'n_words': 518}