1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Add new constructor to accept vector of exported names while creating

InternalizePass.

llvm-svn: 29222
This commit is contained in:
Devang Patel 2006-07-20 17:48:05 +00:00
parent bf871a2ad5
commit 07e0d34f7d
2 changed files with 13 additions and 0 deletions

View File

@ -117,6 +117,7 @@ ModulePass *createPruneEHPass();
/// the main function is found, all other globals are marked as internal.
///
ModulePass *createInternalizePass(bool InternalizeEverything);
ModulePass *createInternalizePass(const std::vector<const char *> &exportList);
//===----------------------------------------------------------------------===//
/// createDeadArgEliminationPass - This pass removes arguments from functions

View File

@ -45,6 +45,7 @@ namespace {
bool DontInternalize;
public:
InternalizePass(bool InternalizeEverything = true);
InternalizePass(const std::vector <const char *>& exportList);
void LoadFile(const char *Filename);
virtual bool runOnModule(Module &M);
};
@ -62,6 +63,13 @@ InternalizePass::InternalizePass(bool InternalizeEverything)
DontInternalize = true;
}
InternalizePass::InternalizePass(const std::vector<const char *>&exportList) {
for(std::vector<const char *>::const_iterator itr = exportList.begin();
itr != exportList.end(); itr++) {
ExternalNames.insert(*itr);
}
}
void InternalizePass::LoadFile(const char *Filename) {
// Load the APIFile...
std::ifstream In(Filename);
@ -151,3 +159,7 @@ bool InternalizePass::runOnModule(Module &M) {
ModulePass *llvm::createInternalizePass(bool InternalizeEverything) {
return new InternalizePass(InternalizeEverything);
}
ModulePass *llvm::createInternalizePass(const std::vector <const char *> &exportList) {
return new InternalizePass(exportList);
}