| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } // end of anonymous namespace | 218 } // end of anonymous namespace |
| 219 | 219 |
| 220 Intrinsics::Intrinsics() { | 220 Intrinsics::Intrinsics() { |
| 221 for (size_t I = 0; I < IceIntrinsicsTableSize; ++I) { | 221 for (size_t I = 0; I < IceIntrinsicsTableSize; ++I) { |
| 222 const struct IceIntrinsicsEntry_ &Entry = IceIntrinsicsTable[I]; | 222 const struct IceIntrinsicsEntry_ &Entry = IceIntrinsicsTable[I]; |
| 223 assert(Entry.Info.NumTypes <= kMaxIntrinsicParameters); | 223 assert(Entry.Info.NumTypes <= kMaxIntrinsicParameters); |
| 224 Map.insert(std::make_pair(IceString(Entry.IntrinsicName), Entry.Info)); | 224 Map.insert(std::make_pair(IceString(Entry.IntrinsicName), Entry.Info)); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 Intrinsics::~Intrinsics() {} | 228 Intrinsics::~Intrinsics() = default; |
| 229 | 229 |
| 230 const Intrinsics::FullIntrinsicInfo *Intrinsics::find(const IceString &Name, | 230 const Intrinsics::FullIntrinsicInfo *Intrinsics::find(const IceString &Name, |
| 231 bool &Error) const { | 231 bool &Error) const { |
| 232 static const char LLVMPrefix[] = "llvm."; | 232 static const char LLVMPrefix[] = "llvm."; |
| 233 const size_t LLVMPrefixLen = strlen(LLVMPrefix); | 233 const size_t LLVMPrefixLen = strlen(LLVMPrefix); |
| 234 Error = false; | 234 Error = false; |
| 235 if (Name.substr(0, LLVMPrefixLen) != LLVMPrefix) | 235 if (Name.substr(0, LLVMPrefixLen) != LLVMPrefix) |
| 236 return nullptr; | 236 return nullptr; |
| 237 IceString NameSuffix = Name.substr(LLVMPrefixLen); | 237 IceString NameSuffix = Name.substr(LLVMPrefixLen); |
| 238 auto it = Map.find(NameSuffix); | 238 auto it = Map.find(NameSuffix); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 return Intrinsics::IsValidCall; | 335 return Intrinsics::IsValidCall; |
| 336 } | 336 } |
| 337 | 337 |
| 338 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const { | 338 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const { |
| 339 assert(NumTypes > 1); | 339 assert(NumTypes > 1); |
| 340 assert(Index + 1 < NumTypes); | 340 assert(Index + 1 < NumTypes); |
| 341 return Signature[Index + 1]; | 341 return Signature[Index + 1]; |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // end of namespace Ice | 344 } // end of namespace Ice |
| OLD | NEW |