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