| 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 30 matching lines...) Expand all Loading... |
| 41 const ErrorCode &getErrorStatus() const { return ErrorStatus; } | 41 const ErrorCode &getErrorStatus() const { return ErrorStatus; } |
| 42 | 42 |
| 43 GlobalContext *getContext() const { return Ctx; } | 43 GlobalContext *getContext() const { return Ctx; } |
| 44 | 44 |
| 45 const ClFlags &getFlags() const { return Ctx->getFlags(); } | 45 const ClFlags &getFlags() const { return Ctx->getFlags(); } |
| 46 | 46 |
| 47 /// Translates the constructed ICE function Fcn to machine code. | 47 /// Translates the constructed ICE function Fcn to machine code. |
| 48 /// Takes ownership of Func. | 48 /// Takes ownership of Func. |
| 49 void translateFcn(std::unique_ptr<Cfg> Func); | 49 void translateFcn(std::unique_ptr<Cfg> Func); |
| 50 | 50 |
| 51 /// Emits the constant pool. | |
| 52 void emitConstants(); | |
| 53 | |
| 54 /// If there was an error during bitcode reading/parsing, copy the | |
| 55 /// error code into the GlobalContext. | |
| 56 void transferErrorCode() const; | |
| 57 | |
| 58 /// Lowers the given list of global addresses to target. Generates | 51 /// Lowers the given list of global addresses to target. Generates |
| 59 /// list of corresponding variable declarations. | 52 /// list of corresponding variable declarations. |
| 60 void | 53 void |
| 61 lowerGlobals(std::unique_ptr<VariableDeclarationList> VariableDeclarations); | 54 lowerGlobals(std::unique_ptr<VariableDeclarationList> VariableDeclarations); |
| 62 | 55 |
| 63 /// Creates a name using the given prefix and corresponding index. | 56 /// Creates a name using the given prefix and corresponding index. |
| 64 std::string createUnnamedName(const IceString &Prefix, SizeT Index); | 57 std::string createUnnamedName(const IceString &Prefix, SizeT Index); |
| 65 | 58 |
| 66 /// Reports if there is a (potential) conflict between Name, and using | 59 /// Reports if there is a (potential) conflict between Name, and using |
| 67 /// Prefix to name unnamed names. Errors are put on Ostream. | 60 /// Prefix to name unnamed names. Errors are put on Ostream. |
| 68 /// Returns true if there isn't a potential conflict. | 61 /// Returns true if there isn't a potential conflict. |
| 69 bool checkIfUnnamedNameSafe(const IceString &Name, const char *Kind, | 62 bool checkIfUnnamedNameSafe(const IceString &Name, const char *Kind, |
| 70 const IceString &Prefix); | 63 const IceString &Prefix); |
| 71 | 64 |
| 72 uint32_t getNextSequenceNumber() { return NextSequenceNumber++; } | 65 uint32_t getNextSequenceNumber() { return NextSequenceNumber++; } |
| 73 | 66 |
| 74 protected: | 67 protected: |
| 75 GlobalContext *Ctx; | 68 GlobalContext *Ctx; |
| 76 uint32_t NextSequenceNumber; | 69 uint32_t NextSequenceNumber; |
| 77 // ErrorCode of the translation. | 70 // ErrorCode of the translation. |
| 78 ErrorCode ErrorStatus; | 71 ErrorCode ErrorStatus; |
| 79 }; | 72 }; |
| 80 | 73 |
| 81 } // end of namespace Ice | 74 } // end of namespace Ice |
| 82 | 75 |
| 83 #endif // SUBZERO_SRC_ICETRANSLATOR_H | 76 #endif // SUBZERO_SRC_ICETRANSLATOR_H |
| OLD | NEW |