LLVM  4.0.0
Public Member Functions | List of all members
llvm::InternalizePass Class Reference

A pass that internalizes all functions and variables other than those that must be preserved according to MustPreserveGV. More...

#include <Internalize.h>

Inheritance diagram for llvm::InternalizePass:
[legend]
Collaboration diagram for llvm::InternalizePass:
[legend]

Public Member Functions

 InternalizePass ()
 
 InternalizePass (std::function< bool(const GlobalValue &)> MustPreserveGV)
 
bool internalizeModule (Module &TheModule, CallGraph *CG=nullptr)
 Run the internalizer on TheModule, returns true if any changes was made. More...
 
PreservedAnalyses run (Module &M, ModuleAnalysisManager &AM)
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::PassInfoMixin< InternalizePass >
static StringRef name ()
 Gets the name of the pass we are mixed into. More...
 

Detailed Description

A pass that internalizes all functions and variables other than those that must be preserved according to MustPreserveGV.

Definition at line 37 of file Internalize.h.

Constructor & Destructor Documentation

InternalizePass::InternalizePass ( )

Definition at line 240 of file Internalize.cpp.

llvm::InternalizePass::InternalizePass ( std::function< bool(const GlobalValue &)>  MustPreserveGV)
inline

Definition at line 56 of file Internalize.h.

Member Function Documentation

bool InternalizePass::internalizeModule ( Module TheModule,
CallGraph CG = nullptr 
)

Run the internalizer on TheModule, returns true if any changes was made.

If the CallGraph CG is supplied, it will be updated when internalizing a function (by removing any edge from the "external node")

Definition at line 153 of file Internalize.cpp.

References llvm::collectUsedGlobalVariables(), llvm::dbgs(), DEBUG, llvm::StringMapImpl::empty(), F, llvm::Module::getComdatSymbolTable(), llvm::CallGraph::getExternalCallingNode(), llvm::Value::getName(), I, llvm::StringSet< AllocatorTy >::insert(), and llvm::CallGraphNode::removeOneAbstractEdgeTo().

Referenced by llvm::internalizeModule(), and run().

PreservedAnalyses InternalizePass::run ( Module M,
ModuleAnalysisManager AM 
)

The documentation for this class was generated from the following files: