| 417 | } |
| 418 | |
| 419 | std::string getPtrPortableFormatDescriptor(PointerType const* PTy) |
| 420 | { |
| 421 | const auto Size = PTy->getSize(); |
| 422 | switch (Size) { |
| 423 | case 1: |
| 424 | return "B"; |
| 425 | case 2: |
| 426 | return "H"; |
| 427 | case 4: |
| 428 | return "I"; |
| 429 | case 8: |
| 430 | return "Q"; |
| 431 | default: |
| 432 | break; |
| 433 | } |
| 434 | return std::to_string(Size) + "B"; |
| 435 | } |
| 436 | |
| 437 | template <class BTyFunc, class PtrTyFunc> |
| 438 | std::string getFormatDescriptorImpl(Type const* Ty, BTyFunc BTyFormat, PtrTyFunc PtrTyFormat) |