OLD | NEW |
1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// | 1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
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 /// \file | 10 /// \file |
11 /// \brief Defines a driver for translating PNaCl bitcode into native code. | 11 /// \brief Defines a driver for translating PNaCl bitcode into native code. |
12 /// | 12 /// |
13 /// The driver can either directly parse the binary bitcode file, or use LLVM | 13 /// The driver can either directly parse the binary bitcode file, or use LLVM |
14 /// routines to parse a textual bitcode file into LLVM IR and then convert LLVM | 14 /// routines to parse a textual bitcode file into LLVM IR and then convert LLVM |
15 /// IR into ICE. In either case, the high-level ICE is then compiled down to | 15 /// IR into ICE. In either case, the high-level ICE is then compiled down to |
16 /// native code, as either an ELF object file or a textual asm file. | 16 /// native code, as either an ELF object file or a textual asm file. |
17 /// | 17 /// |
18 //===----------------------------------------------------------------------===// | 18 //===----------------------------------------------------------------------===// |
19 | 19 |
20 #include "IceCompiler.h" | 20 #include "IceCompiler.h" |
21 | 21 |
22 #include "IceBuildDefs.h" | 22 #include "IceBuildDefs.h" |
23 #include "IceCfg.h" | 23 #include "IceCfg.h" |
24 #include "IceClFlags.h" | 24 #include "IceClFlags.h" |
25 #include "IceClFlagsExtra.h" | 25 #include "IceClFlagsExtra.h" |
26 #include "IceConverter.h" | 26 #include "IceConverter.h" |
27 #include "IceELFObjectWriter.h" | 27 #include "IceELFObjectWriter.h" |
28 #include "PNaClTranslator.h" | 28 #include "PNaClTranslator.h" |
29 | 29 |
| 30 #ifdef __clang__ |
30 #pragma clang diagnostic push | 31 #pragma clang diagnostic push |
31 #pragma clang diagnostic ignored "-Wunused-parameter" | 32 #pragma clang diagnostic ignored "-Wunused-parameter" |
| 33 #endif // __clang__ |
| 34 |
32 #include "llvm/ADT/STLExtras.h" | 35 #include "llvm/ADT/STLExtras.h" |
33 #include "llvm/Bitcode/NaCl/NaClReaderWriter.h" | 36 #include "llvm/Bitcode/NaCl/NaClReaderWriter.h" |
34 #include "llvm/IR/LLVMContext.h" | 37 #include "llvm/IR/LLVMContext.h" |
35 #include "llvm/IR/Module.h" | 38 #include "llvm/IR/Module.h" |
36 #include "llvm/IRReader/IRReader.h" | 39 #include "llvm/IRReader/IRReader.h" |
37 #include "llvm/Support/SourceMgr.h" | 40 #include "llvm/Support/SourceMgr.h" |
38 #include "llvm/Support/StreamingMemoryObject.h" | 41 #include "llvm/Support/StreamingMemoryObject.h" |
39 | 42 |
| 43 #ifdef __clang__ |
| 44 #pragma clang diagnostic pop |
| 45 #endif // __clang__ |
| 46 |
40 #include <regex> | 47 #include <regex> |
41 | 48 |
42 #pragma clang diagnostic pop | |
43 | |
44 namespace Ice { | 49 namespace Ice { |
45 | 50 |
46 namespace { | 51 namespace { |
47 | 52 |
48 struct { | 53 struct { |
49 const char *FlagName; | 54 const char *FlagName; |
50 bool FlagValue; | 55 bool FlagValue; |
51 } ConditionalBuildAttributes[] = { | 56 } ConditionalBuildAttributes[] = { |
52 {"dump", BuildDefs::dump()}, | 57 {"dump", BuildDefs::dump()}, |
53 {"llvm_cl", BuildDefs::llvmCl()}, | 58 {"llvm_cl", BuildDefs::llvmCl()}, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 167 |
163 if (Ctx.getFlags().getTimeEachFunction()) { | 168 if (Ctx.getFlags().getTimeEachFunction()) { |
164 constexpr bool DumpCumulative = false; | 169 constexpr bool DumpCumulative = false; |
165 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); | 170 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); |
166 } | 171 } |
167 constexpr bool FinalStats = true; | 172 constexpr bool FinalStats = true; |
168 Ctx.dumpStats("_FINAL_", FinalStats); | 173 Ctx.dumpStats("_FINAL_", FinalStats); |
169 } | 174 } |
170 | 175 |
171 } // end of namespace Ice | 176 } // end of namespace Ice |
OLD | NEW |