2011-10-31 23:58:51 +00:00
|
|
|
//===-- ModuleUtils.h - Functions to manipulate Modules ---------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This family of functions perform manipulations on Modules.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-10 00:45:19 +00:00
|
|
|
#ifndef LLVM_TRANSFORMS_UTILS_MODULEUTILS_H
|
|
|
|
#define LLVM_TRANSFORMS_UTILS_MODULEUTILS_H
|
2011-10-31 23:58:51 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Module;
|
|
|
|
class Function;
|
2013-07-25 03:23:25 +00:00
|
|
|
class GlobalValue;
|
|
|
|
class GlobalVariable;
|
2014-08-21 05:55:13 +00:00
|
|
|
template <class PtrType> class SmallPtrSetImpl;
|
2011-10-31 23:58:51 +00:00
|
|
|
|
|
|
|
/// Append F to the list of global ctors of module M with the given Priority.
|
|
|
|
/// This wraps the function in the appropriate structure and stores it along
|
|
|
|
/// side other global constructors. For details see
|
|
|
|
/// http://llvm.org/docs/LangRef.html#intg_global_ctors
|
|
|
|
void appendToGlobalCtors(Module &M, Function *F, int Priority);
|
|
|
|
|
2011-12-15 21:59:03 +00:00
|
|
|
/// Same as appendToGlobalCtors(), but for global dtors.
|
|
|
|
void appendToGlobalDtors(Module &M, Function *F, int Priority);
|
|
|
|
|
2013-07-25 03:23:25 +00:00
|
|
|
/// \brief Given "llvm.used" or "llvm.compiler.used" as a global name, collect
|
|
|
|
/// the initializer elements of that global in Set and return the global itself.
|
|
|
|
GlobalVariable *collectUsedGlobalVariables(Module &M,
|
2014-08-21 05:55:13 +00:00
|
|
|
SmallPtrSetImpl<GlobalValue *> &Set,
|
2013-07-25 03:23:25 +00:00
|
|
|
bool CompilerUsed);
|
2011-10-31 23:58:51 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2013-01-10 00:45:19 +00:00
|
|
|
#endif // LLVM_TRANSFORMS_UTILS_MODULEUTILS_H
|