OLD | NEW |
1 //===- subzero/src/IceDefs.h - Common Subzero declarations ------*- C++ -*-===// | 1 //===- subzero/src/IceDefs.h - Common Subzero 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 template <typename T> T *allocate_variable_declaration() { | 170 template <typename T> T *allocate_variable_declaration() { |
171 static_assert(!std::is_trivially_destructible<T>::value, | 171 static_assert(!std::is_trivially_destructible<T>::value, |
172 "allocate_variable_declaration expects non-trivially " | 172 "allocate_variable_declaration expects non-trivially " |
173 "destructible types."); | 173 "destructible types."); |
174 T *Ret = Arena->Allocate<T>(); | 174 T *Ret = Arena->Allocate<T>(); |
175 Dtors.emplace_back([Ret]() { Ret->~T(); }); | 175 Dtors.emplace_back([Ret]() { Ret->~T(); }); |
176 return Ret; | 176 return Ret; |
177 } | 177 } |
178 | 178 |
179 // This do nothing method is invoked when a global variable is created, but it | 179 // This do nothing method is invoked when a global variable is created, but it |
180 // will not be emitted. If we ever need to track the created variabled, having | 180 // will not be emitted. If we ever need to track the created variable, having |
181 // this hook is handy. | 181 // this hook is handy. |
182 void willNotBeEmitted(VariableDeclaration *) {} | 182 void willNotBeEmitted(VariableDeclaration *) {} |
183 | 183 |
184 /// Merges Other with this, effectively resetting Other to an empty state. | 184 /// Merges Other with this, effectively resetting Other to an empty state. |
185 void merge(VariableDeclarationList *Other) { | 185 void merge(VariableDeclarationList *Other) { |
186 assert(Other != nullptr); | 186 assert(Other != nullptr); |
187 addArena(std::move(Other->Arena)); | 187 addArena(std::move(Other->Arena)); |
188 for (std::size_t i = 0; i < Other->MergedArenas.size(); ++i) { | 188 for (std::size_t i = 0; i < Other->MergedArenas.size(); ++i) { |
189 addArena(std::move(Other->MergedArenas[i])); | 189 addArena(std::move(Other->MergedArenas[i])); |
190 } | 190 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 RPE_PooledConstantReordering, | 434 RPE_PooledConstantReordering, |
435 RPE_RegAllocRandomization, | 435 RPE_RegAllocRandomization, |
436 RPE_num | 436 RPE_num |
437 }; | 437 }; |
438 | 438 |
439 using RelocOffsetArray = llvm::SmallVector<class RelocOffset *, 4>; | 439 using RelocOffsetArray = llvm::SmallVector<class RelocOffset *, 4>; |
440 | 440 |
441 } // end of namespace Ice | 441 } // end of namespace Ice |
442 | 442 |
443 #endif // SUBZERO_SRC_ICEDEFS_H | 443 #endif // SUBZERO_SRC_ICEDEFS_H |
OLD | NEW |