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:
parent
bf871a2ad5
commit
07e0d34f7d
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user