Add new constructor to accept vector of exported names while creating

InternalizePass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2006-07-20 17:48:05 +00:00
parent ae6153f943
commit 753d94a1c8
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);
}