Extended support for native Windows C++ EH outlining
[oota-llvm.git] / include / llvm / Transforms / Utils / ModuleUtils.h
index bb7fc06bf5307f4e2c3dc40bd517363c0e11f6a1..16904f16e3698237e39ecd41c21bfebe7e6e0c77 100644 (file)
@@ -18,6 +18,9 @@ namespace llvm {
 
 class Module;
 class Function;
+class GlobalValue;
+class GlobalVariable;
+template <class PtrType> class SmallPtrSetImpl;
 
 /// 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
@@ -28,6 +31,11 @@ void appendToGlobalCtors(Module &M, Function *F, int Priority);
 /// Same as appendToGlobalCtors(), but for global dtors.
 void appendToGlobalDtors(Module &M, Function *F, int Priority);
 
+/// \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,
+                                           SmallPtrSetImpl<GlobalValue *> &Set,
+                                           bool CompilerUsed);
 } // End llvm namespace
 
 #endif //  LLVM_TRANSFORMS_UTILS_MODULEUTILS_H