llvm.org GIT mirror llvm / 4d544cd
add an option for timing bc file reading. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33977 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 12 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
3838 static cl::opt
3939 Force("f", cl::desc("Overwrite output files"));
4040
41 static cl::opt
42 DontPrint("disable-output", cl::desc("Don't output the .ll file"), cl::Hidden);
43
4144 int main(int argc, char **argv) {
4245 llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
4346 try {
5760 return 1;
5861 }
5962
60 if (OutputFilename != "") { // Specified an output filename?
63 if (DontPrint) {
64 // Just use stdout. We won't actually print anything on it.
65 } else if (OutputFilename != "") { // Specified an output filename?
6166 if (OutputFilename != "-") { // Not stdout?
6267 if (!Force && std::ifstream(OutputFilename.c_str())) {
6368 // If force is not specified, make sure not to overwrite a file!
101106 }
102107
103108 // All that llvm-dis does is write the assembly to a file.
104 PassManager Passes;
105 OStream L(*Out);
106 Passes.add(new PrintModulePass(&L));
107 Passes.run(*M.get());
109 if (!DontPrint) {
110 PassManager Passes;
111 OStream L(*Out);
112 Passes.add(new PrintModulePass(&L));
113 Passes.run(*M.get());
114 }
108115
109116 if (Out != &std::cout) {
110117 ((std::ofstream*)Out)->close();