LLVM  6.0.0svn
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 "llvm/Transforms/IPO/Internalize.h"

Inheritance diagram for llvm::InternalizePass:
Inheritance graph
[legend]
Collaboration diagram for llvm::InternalizePass:
Collaboration graph
[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() [1/2]

InternalizePass::InternalizePass ( )

Definition at line 240 of file Internalize.cpp.

Referenced by llvm::internalizeModule().

◆ InternalizePass() [2/2]

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

Definition at line 56 of file Internalize.h.

References internalizeModule(), and run().

Member Function Documentation

◆ internalizeModule()

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, and llvm::CallGraphNode::removeOneAbstractEdgeTo().

Referenced by InternalizePass(), and run().

◆ run()

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

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