LLVM API Documentation

CtorUtils.h
Go to the documentation of this file.
00001 //===- CtorUtils.h - Helpers for working with global_ctors ------*- 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 //
00010 // This file defines functions that are used to process llvm.global_ctors.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_TRANSFORMS_UTILS_CTORUTILS_H
00015 #define LLVM_TRANSFORMS_UTILS_CTORUTILS_H
00016 
00017 #include "llvm/ADT/STLExtras.h"
00018 
00019 namespace llvm {
00020 
00021 class GlobalVariable;
00022 class Function;
00023 class Module;
00024 
00025 /// Call "ShouldRemove" for every entry in M's global_ctor list and remove the
00026 /// entries for which it returns true.  Return true if anything changed.
00027 bool optimizeGlobalCtorsList(Module &M,
00028                              function_ref<bool(Function *)> ShouldRemove);
00029 
00030 } // End llvm namespace
00031 
00032 #endif