OLD | NEW |
1 //===- subzero/src/IceIntrinsics.cpp - Functions related to intrinsics ----===// | 1 //===- subzero/src/IceIntrinsics.cpp - Functions related to intrinsics ----===// |
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 implements the Intrinsics utilities for matching and | 10 // This file implements the Intrinsics utilities for matching and |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 const size_t IceIntrinsicsTableSize = llvm::array_lengthof(IceIntrinsicsTable); | 201 const size_t IceIntrinsicsTableSize = llvm::array_lengthof(IceIntrinsicsTable); |
202 | 202 |
203 #undef INTRIN | 203 #undef INTRIN |
204 | 204 |
205 } // end of anonymous namespace | 205 } // end of anonymous namespace |
206 | 206 |
207 Intrinsics::Intrinsics() { | 207 Intrinsics::Intrinsics() { |
208 for (size_t I = 0; I < IceIntrinsicsTableSize; ++I) { | 208 for (size_t I = 0; I < IceIntrinsicsTableSize; ++I) { |
209 const struct IceIntrinsicsEntry_ &Entry = IceIntrinsicsTable[I]; | 209 const struct IceIntrinsicsEntry_ &Entry = IceIntrinsicsTable[I]; |
210 assert(Entry.Info.NumTypes <= kMaxIntrinsicParameters); | 210 assert(Entry.Info.NumTypes <= kMaxIntrinsicParameters); |
211 map.insert(std::make_pair(IceString(Entry.IntrinsicName), Entry.Info)); | 211 Map.insert(std::make_pair(IceString(Entry.IntrinsicName), Entry.Info)); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 Intrinsics::~Intrinsics() {} | 215 Intrinsics::~Intrinsics() {} |
216 | 216 |
217 const Intrinsics::FullIntrinsicInfo * | 217 const Intrinsics::FullIntrinsicInfo * |
218 Intrinsics::find(const IceString &Name) const { | 218 Intrinsics::find(const IceString &Name) const { |
219 IntrinsicMap::const_iterator it = map.find(Name); | 219 auto it = Map.find(Name); |
220 if (it == map.end()) | 220 if (it == Map.end()) |
221 return NULL; | 221 return NULL; |
222 return &it->second; | 222 return &it->second; |
223 } | 223 } |
224 | 224 |
225 bool Intrinsics::VerifyMemoryOrder(uint64_t Order) { | 225 bool Intrinsics::VerifyMemoryOrder(uint64_t Order) { |
226 // There is only one memory ordering for atomics allowed right now. | 226 // There is only one memory ordering for atomics allowed right now. |
227 return Order == Intrinsics::MemoryOrderSequentiallyConsistent; | 227 return Order == Intrinsics::MemoryOrderSequentiallyConsistent; |
228 } | 228 } |
229 | 229 |
230 Intrinsics::ValidateCallValue | 230 Intrinsics::ValidateCallValue |
(...skipping 19 matching lines...) Expand all Loading... |
250 return Intrinsics::IsValidCall; | 250 return Intrinsics::IsValidCall; |
251 } | 251 } |
252 | 252 |
253 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const { | 253 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const { |
254 assert(NumTypes > 1); | 254 assert(NumTypes > 1); |
255 assert(Index + 1 < NumTypes); | 255 assert(Index + 1 < NumTypes); |
256 return Signature[Index + 1]; | 256 return Signature[Index + 1]; |
257 } | 257 } |
258 | 258 |
259 } // end of namespace Ice | 259 } // end of namespace Ice |
OLD | NEW |