OLD | NEW |
1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- C++ -*-===// | 1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- 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 representation of function declarations, | 10 // This file declares the representation of function declarations, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 Linkage = NewLinkage; | 54 Linkage = NewLinkage; |
55 } | 55 } |
56 virtual ~GlobalDeclaration() {} | 56 virtual ~GlobalDeclaration() {} |
57 | 57 |
58 /// Prints out type of the global declaration. | 58 /// Prints out type of the global declaration. |
59 virtual void dumpType(Ostream &Stream) const = 0; | 59 virtual void dumpType(Ostream &Stream) const = 0; |
60 | 60 |
61 /// Prints out the global declaration. | 61 /// Prints out the global declaration. |
62 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; | 62 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; |
63 void dump(Ostream &Stream) const { | 63 void dump(Ostream &Stream) const { |
| 64 if (!ALLOW_DUMP) |
| 65 return; |
64 GlobalContext *const Ctx = nullptr; | 66 GlobalContext *const Ctx = nullptr; |
65 dump(Ctx, Stream); | 67 dump(Ctx, Stream); |
66 } | 68 } |
67 | 69 |
68 /// Returns true if when emitting names, we should suppress mangling. | 70 /// Returns true if when emitting names, we should suppress mangling. |
69 virtual bool getSuppressMangling() const = 0; | 71 virtual bool getSuppressMangling() const = 0; |
70 | 72 |
71 // Mangles name for cross tests, unless external and not defined locally | 73 // Mangles name for cross tests, unless external and not defined locally |
72 // (so that relocations accross llvm2ice and pnacl-llc will work). | 74 // (so that relocations accross llvm2ice and pnacl-llc will work). |
73 virtual IceString mangleName(GlobalContext *Ctx) const { | 75 virtual IceString mangleName(GlobalContext *Ctx) const { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 enum InitializerKind { | 144 enum InitializerKind { |
143 DataInitializerKind, | 145 DataInitializerKind, |
144 ZeroInitializerKind, | 146 ZeroInitializerKind, |
145 RelocInitializerKind | 147 RelocInitializerKind |
146 }; | 148 }; |
147 InitializerKind getKind() const { return Kind; } | 149 InitializerKind getKind() const { return Kind; } |
148 virtual ~Initializer() {} | 150 virtual ~Initializer() {} |
149 virtual SizeT getNumBytes() const = 0; | 151 virtual SizeT getNumBytes() const = 0; |
150 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; | 152 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; |
151 void dump(Ostream &Stream) const { | 153 void dump(Ostream &Stream) const { |
152 dump(nullptr, Stream); | 154 if (ALLOW_DUMP) |
| 155 dump(nullptr, Stream); |
153 } | 156 } |
154 virtual void dumpType(Ostream &Stream) const; | 157 virtual void dumpType(Ostream &Stream) const; |
155 | 158 |
156 protected: | 159 protected: |
157 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} | 160 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} |
158 | 161 |
159 private: | 162 private: |
160 const InitializerKind Kind; | 163 const InitializerKind Kind; |
161 }; | 164 }; |
162 | 165 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 template <class StreamType> | 318 template <class StreamType> |
316 inline StreamType &operator<<(StreamType &Stream, | 319 inline StreamType &operator<<(StreamType &Stream, |
317 const GlobalDeclaration &Addr) { | 320 const GlobalDeclaration &Addr) { |
318 Addr.dump(Stream); | 321 Addr.dump(Stream); |
319 return Stream; | 322 return Stream; |
320 } | 323 } |
321 | 324 |
322 } // end of namespace Ice | 325 } // end of namespace Ice |
323 | 326 |
324 #endif // SUBZERO_SRC_ICEGLOBALINITS_H | 327 #endif // SUBZERO_SRC_ICEGLOBALINITS_H |
OLD | NEW |