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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 bool isInternal() const { | 47 bool isInternal() const { |
48 return Linkage == llvm::GlobalValue::InternalLinkage; | 48 return Linkage == llvm::GlobalValue::InternalLinkage; |
49 } | 49 } |
50 llvm::GlobalValue::LinkageTypes getLinkage() const { return Linkage; } | 50 llvm::GlobalValue::LinkageTypes getLinkage() const { return Linkage; } |
51 bool isExternal() const { | 51 bool isExternal() const { |
52 return Linkage == llvm::GlobalValue::ExternalLinkage; | 52 return Linkage == llvm::GlobalValue::ExternalLinkage; |
53 } | 53 } |
54 void setLinkage(llvm::GlobalValue::LinkageTypes NewLinkage) { | 54 void setLinkage(llvm::GlobalValue::LinkageTypes NewLinkage) { |
55 Linkage = NewLinkage; | 55 Linkage = NewLinkage; |
56 } | 56 } |
57 virtual ~GlobalDeclaration() {} | 57 virtual ~GlobalDeclaration() = default; |
58 | 58 |
59 /// Prints out type of the global declaration. | 59 /// Prints out type of the global declaration. |
60 virtual void dumpType(Ostream &Stream) const = 0; | 60 virtual void dumpType(Ostream &Stream) const = 0; |
61 | 61 |
62 /// Prints out the global declaration. | 62 /// Prints out the global declaration. |
63 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; | 63 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; |
64 void dump(Ostream &Stream) const { | 64 void dump(Ostream &Stream) const { |
65 if (!ALLOW_DUMP) | 65 if (!ALLOW_DUMP) |
66 return; | 66 return; |
67 GlobalContext *const Ctx = nullptr; | 67 GlobalContext *const Ctx = nullptr; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 Initializer &operator=(const Initializer &) = delete; | 135 Initializer &operator=(const Initializer &) = delete; |
136 | 136 |
137 public: | 137 public: |
138 /// Discriminator for LLVM-style RTTI. | 138 /// Discriminator for LLVM-style RTTI. |
139 enum InitializerKind { | 139 enum InitializerKind { |
140 DataInitializerKind, | 140 DataInitializerKind, |
141 ZeroInitializerKind, | 141 ZeroInitializerKind, |
142 RelocInitializerKind | 142 RelocInitializerKind |
143 }; | 143 }; |
144 InitializerKind getKind() const { return Kind; } | 144 InitializerKind getKind() const { return Kind; } |
145 virtual ~Initializer() {} | 145 virtual ~Initializer() = default; |
146 virtual SizeT getNumBytes() const = 0; | 146 virtual SizeT getNumBytes() const = 0; |
147 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; | 147 virtual void dump(GlobalContext *Ctx, Ostream &Stream) const = 0; |
148 void dump(Ostream &Stream) const { | 148 void dump(Ostream &Stream) const { |
149 if (ALLOW_DUMP) | 149 if (ALLOW_DUMP) |
150 dump(nullptr, Stream); | 150 dump(nullptr, Stream); |
151 } | 151 } |
152 virtual void dumpType(Ostream &Stream) const; | 152 virtual void dumpType(Ostream &Stream) const; |
153 | 153 |
154 protected: | 154 protected: |
155 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} | 155 explicit Initializer(InitializerKind Kind) : Kind(Kind) {} |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 template <class StreamType> | 319 template <class StreamType> |
320 inline StreamType &operator<<(StreamType &Stream, | 320 inline StreamType &operator<<(StreamType &Stream, |
321 const GlobalDeclaration &Addr) { | 321 const GlobalDeclaration &Addr) { |
322 Addr.dump(Stream); | 322 Addr.dump(Stream); |
323 return Stream; | 323 return Stream; |
324 } | 324 } |
325 | 325 |
326 } // end of namespace Ice | 326 } // end of namespace Ice |
327 | 327 |
328 #endif // SUBZERO_SRC_ICEGLOBALINITS_H | 328 #endif // SUBZERO_SRC_ICEGLOBALINITS_H |
OLD | NEW |