| OLD | NEW |
| 1 //===-- pnacl-benchmark.cpp -----------------------------------------------===// | 1 //===-- pnacl-benchmark.cpp -----------------------------------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // pnacl-benchmark: various benchmarking tools for the PNaCl LLVM toolchain. | 10 // pnacl-benchmark: various benchmarking tools for the PNaCl LLVM toolchain. |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 AnalysisDumpOptions DumpOptions; | 203 AnalysisDumpOptions DumpOptions; |
| 204 AnalyzeBitcodeInBuffer(FileBuf, nulls(), DumpOptions); | 204 AnalyzeBitcodeInBuffer(FileBuf, nulls(), DumpOptions); |
| 205 } | 205 } |
| 206 | 206 |
| 207 // Actual LLVM IR parsing and formation from the bitcode | 207 // Actual LLVM IR parsing and formation from the bitcode |
| 208 { | 208 { |
| 209 TimingOperationBlock T("LLVM IR parsing", BufSize); | 209 TimingOperationBlock T("LLVM IR parsing", BufSize); |
| 210 SMDiagnostic Err; | 210 SMDiagnostic Err; |
| 211 raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr; | 211 raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr; |
| 212 Module *M = NaClParseIRFile(InputFilename, PNaClFormat, | 212 std::unique_ptr<Module> M = NaClParseIRFile( |
| 213 Err, Verbose, getGlobalContext()); | 213 InputFilename, PNaClFormat, |
| 214 Err, Verbose, getGlobalContext()); |
| 214 | 215 |
| 215 if (!M) { | 216 if (!M) { |
| 216 report_fatal_error("Unable to NaClParseIRFile"); | 217 report_fatal_error("Unable to NaClParseIRFile"); |
| 217 } | 218 } |
| 218 } | 219 } |
| 219 } | 220 } |
| 220 | 221 |
| 221 int main(int argc, char **argv) { | 222 int main(int argc, char **argv) { |
| 222 sys::PrintStackTraceOnErrorSignal(); | 223 sys::PrintStackTraceOnErrorSignal(); |
| 223 PrettyStackTraceProgram X(argc, argv); | 224 PrettyStackTraceProgram X(argc, argv); |
| 224 | 225 |
| 225 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. | 226 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. |
| 226 cl::ParseCommandLineOptions(argc, argv, "pnacl-benchmark\n"); | 227 cl::ParseCommandLineOptions(argc, argv, "pnacl-benchmark\n"); |
| 227 | 228 |
| 228 for (unsigned i = 0; i < NumRuns; i++) { | 229 for (unsigned i = 0; i < NumRuns; i++) { |
| 229 BenchmarkIRParsing(); | 230 BenchmarkIRParsing(); |
| 230 } | 231 } |
| 231 | 232 |
| 232 return 0; | 233 return 0; |
| 233 } | 234 } |
| OLD | NEW |