OLD | NEW |
1 //===- subzero/src/IceTranslator.h - ICE to machine code --------*- C++ -*-===// | 1 //===- subzero/src/IceTranslator.h - ICE to machine code --------*- C++ -*-===// |
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 // This file declares the general driver class for translating ICE to | 10 // This file declares the general driver class for translating ICE to |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void translateFcn(Cfg *Fcn); | 49 void translateFcn(Cfg *Fcn); |
50 | 50 |
51 /// Emits the constant pool. | 51 /// Emits the constant pool. |
52 void emitConstants(); | 52 void emitConstants(); |
53 | 53 |
54 // Walks module and generates names for unnamed globals and | 54 // Walks module and generates names for unnamed globals and |
55 // functions using prefix getFlags().DefaultGlobalPrefix, if the | 55 // functions using prefix getFlags().DefaultGlobalPrefix, if the |
56 // prefix is non-empty. | 56 // prefix is non-empty. |
57 void nameUnnamedGlobalAddresses(llvm::Module *Mod); | 57 void nameUnnamedGlobalAddresses(llvm::Module *Mod); |
58 | 58 |
| 59 // Converts globals to ICE, and then machine code. |
| 60 // TODO(kschimpf) Remove this once we have ported to PNaClTranslator, |
| 61 // and PNaClTranslator generates initializers while parsing. |
| 62 void convertGlobals(llvm::Module *Mod); |
| 63 |
59 protected: | 64 protected: |
60 GlobalContext *Ctx; | 65 GlobalContext *Ctx; |
61 const ClFlags &Flags; | 66 const ClFlags &Flags; |
62 // The exit status of the translation. False is successful. True | 67 // The exit status of the translation. False is successful. True |
63 // otherwise. | 68 // otherwise. |
64 bool ErrorStatus; | 69 bool ErrorStatus; |
65 // Ideally, Func would be inside the methods that converts IR to | 70 // Ideally, Func would be inside the methods that converts IR to |
66 // functions. However, emitting the constant pool requires a valid | 71 // functions. However, emitting the constant pool requires a valid |
67 // Cfg object, so we need to defer deleting the last non-empty Cfg | 72 // Cfg object, so we need to defer deleting the last non-empty Cfg |
68 // object to emit the constant pool (via emitConstants). TODO: | 73 // object to emit the constant pool (via emitConstants). TODO: |
69 // Since all constants are globally pooled in the GlobalContext | 74 // Since all constants are globally pooled in the GlobalContext |
70 // object, change all Constant related functions to use | 75 // object, change all Constant related functions to use |
71 // GlobalContext instead of Cfg, and then make emitConstantPool use | 76 // GlobalContext instead of Cfg, and then make emitConstantPool use |
72 // that. | 77 // that. |
73 llvm::OwningPtr<Cfg> Func; | 78 llvm::OwningPtr<Cfg> Func; |
74 | 79 |
75 private: | 80 private: |
76 Translator(const Translator &) LLVM_DELETED_FUNCTION; | 81 Translator(const Translator &) LLVM_DELETED_FUNCTION; |
77 Translator &operator=(const Translator &) LLVM_DELETED_FUNCTION; | 82 Translator &operator=(const Translator &) LLVM_DELETED_FUNCTION; |
78 }; | 83 }; |
79 } | 84 } |
80 | 85 |
81 #endif // SUBZERO_SRC_ICETRANSLATOR_H | 86 #endif // SUBZERO_SRC_ICETRANSLATOR_H |
OLD | NEW |