forked from OSchip/llvm-project
Run the internalize pass to mark all functions except main internal when
linking the final program to allow smarter optimizations llvm-svn: 2364
This commit is contained in:
parent
ee2e78b86c
commit
f0f014a182
|
@ -23,6 +23,7 @@
|
|||
#include "llvm/Transforms/CleanupGCCOutput.h"
|
||||
#include "llvm/Transforms/ConstantMerge.h"
|
||||
#include "llvm/Transforms/IPO/GlobalDCE.h"
|
||||
#include "llvm/Transforms/IPO/Internalize.h"
|
||||
#include "Support/CommandLine.h"
|
||||
#include "Support/Signals.h"
|
||||
#include <fstream>
|
||||
|
@ -81,8 +82,6 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n",
|
||||
cl::EnableSingleLetterArgValue |
|
||||
|
@ -148,7 +147,7 @@ int main(int argc, char **argv) {
|
|||
// Now that composite has been compiled, scan through the module, looking for
|
||||
// a main function. If main is defined, mark all other functions internal.
|
||||
//
|
||||
// TODO:
|
||||
Passes.add(createInternalizePass());
|
||||
|
||||
// Now that we have optimized the program, discard unreachable functions...
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue