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 /// \file | 10 /// \file |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 static bool classof(const Initializer *D) { | 272 static bool classof(const Initializer *D) { |
273 return D->getKind() == DataInitializerKind; | 273 return D->getKind() == DataInitializerKind; |
274 } | 274 } |
275 | 275 |
276 private: | 276 private: |
277 DataInitializer(VariableDeclarationList *VDL, | 277 DataInitializer(VariableDeclarationList *VDL, |
278 const llvm::NaClBitcodeRecord::RecordVector &Values) | 278 const llvm::NaClBitcodeRecord::RecordVector &Values) |
279 : Initializer(DataInitializerKind), ContentsSize(Values.size()), | 279 : Initializer(DataInitializerKind), ContentsSize(Values.size()), |
280 // ugh, we should actually do new char[], but this may involve | 280 // ugh, we should actually do new char[], but this may involve |
281 // implementation-specific details. Given that Contents is arena | 281 // implementation-specific details. Given that Contents is arena |
282 // allocated, and never detele[]d, just use char -- | 282 // allocated, and never delete[]d, just use char -- |
283 // AllocOwner->allocate_array will allocate a buffer with the right | 283 // AllocOwner->allocate_array will allocate a buffer with the right |
284 // size. | 284 // size. |
285 Contents(new (VDL->allocate_initializer<char>(ContentsSize)) char) { | 285 Contents(new (VDL->allocate_initializer<char>(ContentsSize)) char) { |
286 for (SizeT I = 0; I < Values.size(); ++I) | 286 for (SizeT I = 0; I < Values.size(); ++I) |
287 Contents[I] = static_cast<int8_t>(Values[I]); | 287 Contents[I] = static_cast<int8_t>(Values[I]); |
288 } | 288 } |
289 | 289 |
290 DataInitializer(VariableDeclarationList *VDL, const char *Str, | 290 DataInitializer(VariableDeclarationList *VDL, const char *Str, |
291 size_t StrLen) | 291 size_t StrLen) |
292 : Initializer(DataInitializerKind), ContentsSize(StrLen), | 292 : Initializer(DataInitializerKind), ContentsSize(StrLen), |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 template <class StreamType> | 513 template <class StreamType> |
514 inline StreamType &operator<<(StreamType &Stream, | 514 inline StreamType &operator<<(StreamType &Stream, |
515 const GlobalDeclaration &Addr) { | 515 const GlobalDeclaration &Addr) { |
516 Addr.dump(Stream); | 516 Addr.dump(Stream); |
517 return Stream; | 517 return Stream; |
518 } | 518 } |
519 | 519 |
520 } // end of namespace Ice | 520 } // end of namespace Ice |
521 | 521 |
522 #endif // SUBZERO_SRC_ICEGLOBALINITS_H | 522 #endif // SUBZERO_SRC_ICEGLOBALINITS_H |
OLD | NEW |