| /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| |* *| |
| |* Attribute classes' member function definitions *| |
| |* *| |
| |* Automatically generated file, do not edit! *| |
| |* *| |
| \*===----------------------------------------------------------------------===*/ |
| |
| AArch64VectorPcsAttr *AArch64VectorPcsAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AArch64VectorPcsAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AArch64VectorPcsAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((aarch64_vector_pcs))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::aarch64_vector_pcs]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::aarch64_vector_pcs]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AArch64VectorPcsAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "aarch64_vector_pcs"; |
| case 1: |
| return "aarch64_vector_pcs"; |
| case 2: |
| return "aarch64_vector_pcs"; |
| } |
| } |
| |
| AMDGPUFlatWorkGroupSizeAttr *AMDGPUFlatWorkGroupSizeAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AMDGPUFlatWorkGroupSizeAttr(getLocation(), C, min, max, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AMDGPUFlatWorkGroupSizeAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((amdgpu_flat_work_group_size(" << getMin() << ", " << getMax() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::amdgpu_flat_work_group_size(" << getMin() << ", " << getMax() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AMDGPUFlatWorkGroupSizeAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "amdgpu_flat_work_group_size"; |
| case 1: |
| return "amdgpu_flat_work_group_size"; |
| } |
| } |
| |
| AMDGPUNumSGPRAttr *AMDGPUNumSGPRAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AMDGPUNumSGPRAttr(getLocation(), C, numSGPR, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AMDGPUNumSGPRAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((amdgpu_num_sgpr(" << getNumSGPR() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::amdgpu_num_sgpr(" << getNumSGPR() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AMDGPUNumSGPRAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "amdgpu_num_sgpr"; |
| case 1: |
| return "amdgpu_num_sgpr"; |
| } |
| } |
| |
| AMDGPUNumVGPRAttr *AMDGPUNumVGPRAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AMDGPUNumVGPRAttr(getLocation(), C, numVGPR, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AMDGPUNumVGPRAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((amdgpu_num_vgpr(" << getNumVGPR() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::amdgpu_num_vgpr(" << getNumVGPR() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AMDGPUNumVGPRAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "amdgpu_num_vgpr"; |
| case 1: |
| return "amdgpu_num_vgpr"; |
| } |
| } |
| |
| AMDGPUWavesPerEUAttr *AMDGPUWavesPerEUAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AMDGPUWavesPerEUAttr(getLocation(), C, min, max, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AMDGPUWavesPerEUAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((amdgpu_waves_per_eu(" << getMin() << ", " << getMax() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::amdgpu_waves_per_eu(" << getMin() << ", " << getMax() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AMDGPUWavesPerEUAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "amdgpu_waves_per_eu"; |
| case 1: |
| return "amdgpu_waves_per_eu"; |
| } |
| } |
| |
| ARMInterruptAttr *ARMInterruptAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ARMInterruptAttr(getLocation(), C, interrupt, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ARMInterruptAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((interrupt(\"" << ARMInterruptAttr::ConvertInterruptTypeToStr(getInterrupt()) << "\")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::interrupt(\"" << ARMInterruptAttr::ConvertInterruptTypeToStr(getInterrupt()) << "\")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ARMInterruptAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "interrupt"; |
| case 1: |
| return "interrupt"; |
| } |
| } |
| |
| AVRInterruptAttr *AVRInterruptAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AVRInterruptAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AVRInterruptAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((interrupt))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::interrupt]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AVRInterruptAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "interrupt"; |
| case 1: |
| return "interrupt"; |
| } |
| } |
| |
| AVRSignalAttr *AVRSignalAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AVRSignalAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AVRSignalAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((signal))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::signal]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AVRSignalAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "signal"; |
| case 1: |
| return "signal"; |
| } |
| } |
| |
| AbiTagAttr *AbiTagAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AbiTagAttr(getLocation(), C, tags_, tags_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AbiTagAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((abi_tag("; |
| bool isFirst = true; |
| for (const auto &Val : tags()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << "\"" << Val << "\""; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::abi_tag("; |
| bool isFirst = true; |
| for (const auto &Val : tags()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << "\"" << Val << "\""; |
| } |
| OS << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AbiTagAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "abi_tag"; |
| case 1: |
| return "abi_tag"; |
| } |
| } |
| |
| AcquireCapabilityAttr *AcquireCapabilityAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AcquireCapabilityAttr(getLocation(), C, args_, args_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AcquireCapabilityAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((acquire_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::acquire_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __attribute__((acquire_shared_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 3 : { |
| OS << " [[clang::acquire_shared_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 4 : { |
| OS << " __attribute__((exclusive_lock_function("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 5 : { |
| OS << " __attribute__((shared_lock_function("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AcquireCapabilityAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "acquire_capability"; |
| case 1: |
| return "acquire_capability"; |
| case 2: |
| return "acquire_shared_capability"; |
| case 3: |
| return "acquire_shared_capability"; |
| case 4: |
| return "exclusive_lock_function"; |
| case 5: |
| return "shared_lock_function"; |
| } |
| } |
| |
| AcquiredAfterAttr *AcquiredAfterAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AcquiredAfterAttr(getLocation(), C, args_, args_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AcquiredAfterAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((acquired_after("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AcquiredAfterAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "acquired_after"; |
| } |
| } |
| |
| AcquiredBeforeAttr *AcquiredBeforeAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AcquiredBeforeAttr(getLocation(), C, args_, args_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AcquiredBeforeAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((acquired_before("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AcquiredBeforeAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "acquired_before"; |
| } |
| } |
| |
| AddressSpaceAttr *AddressSpaceAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AddressSpaceAttr(getLocation(), C, addressSpace, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AddressSpaceAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((address_space(" << getAddressSpace() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::address_space(" << getAddressSpace() << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::address_space(" << getAddressSpace() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AddressSpaceAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "address_space"; |
| case 1: |
| return "address_space"; |
| case 2: |
| return "address_space"; |
| } |
| } |
| |
| AliasAttr *AliasAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AliasAttr(getLocation(), C, getAliasee(), getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AliasAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((alias(\"" << getAliasee() << "\")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::alias(\"" << getAliasee() << "\")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AliasAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "alias"; |
| case 1: |
| return "alias"; |
| } |
| } |
| |
| AlignMac68kAttr *AlignMac68kAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AlignMac68kAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AlignMac68kAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| } |
| |
| const char *AlignMac68kAttr::getSpelling() const { |
| return "(No spelling)"; |
| } |
| |
| AlignValueAttr *AlignValueAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AlignValueAttr(getLocation(), C, alignment, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AlignValueAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((align_value(" << getAlignment() << ")))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AlignValueAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "align_value"; |
| } |
| } |
| |
| bool AlignedAttr::isAlignmentDependent() const { |
| if (isalignmentExpr) |
| return alignmentExpr && (alignmentExpr->isValueDependent() || alignmentExpr->isTypeDependent()); |
| else |
| return alignmentType->getType()->isDependentType(); |
| } |
| unsigned AlignedAttr::getAlignment(ASTContext &Ctx) const { |
| assert(!isAlignmentDependent()); |
| if (isalignmentExpr) |
| return alignmentExpr ? alignmentExpr->EvaluateKnownConstInt(Ctx).getZExtValue() * Ctx.getCharWidth() : Ctx.getTargetDefaultAlignForAttributeAligned(); |
| else |
| return 0; // FIXME |
| } |
| AlignedAttr *AlignedAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AlignedAttr(getLocation(), C, isalignmentExpr, isalignmentExpr ? static_cast<void*>(alignmentExpr) : alignmentType, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AlignedAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((aligned"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!isalignmentExpr || !alignmentExpr) |
| ++TrailingOmittedArgs; |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << "("; |
| OS << ""; |
| if (!(!isalignmentExpr || !alignmentExpr)) { |
| OS << ""; |
| alignmentExpr->printPretty(OS, nullptr, Policy); |
| OS << ""; |
| } |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << ")"; |
| OS << "))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::aligned"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!isalignmentExpr || !alignmentExpr) |
| ++TrailingOmittedArgs; |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << "("; |
| OS << ""; |
| if (!(!isalignmentExpr || !alignmentExpr)) { |
| OS << ""; |
| alignmentExpr->printPretty(OS, nullptr, Policy); |
| OS << ""; |
| } |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << ")"; |
| OS << "]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __declspec(align"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!isalignmentExpr || !alignmentExpr) |
| ++TrailingOmittedArgs; |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << "("; |
| OS << ""; |
| if (!(!isalignmentExpr || !alignmentExpr)) { |
| OS << ""; |
| alignmentExpr->printPretty(OS, nullptr, Policy); |
| OS << ""; |
| } |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << ")"; |
| OS << ")"; |
| break; |
| } |
| case 3 : { |
| OS << " alignas"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!isalignmentExpr || !alignmentExpr) |
| ++TrailingOmittedArgs; |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << "("; |
| OS << ""; |
| if (!(!isalignmentExpr || !alignmentExpr)) { |
| OS << ""; |
| alignmentExpr->printPretty(OS, nullptr, Policy); |
| OS << ""; |
| } |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << ")"; |
| OS << ""; |
| break; |
| } |
| case 4 : { |
| OS << " _Alignas"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!isalignmentExpr || !alignmentExpr) |
| ++TrailingOmittedArgs; |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << "("; |
| OS << ""; |
| if (!(!isalignmentExpr || !alignmentExpr)) { |
| OS << ""; |
| alignmentExpr->printPretty(OS, nullptr, Policy); |
| OS << ""; |
| } |
| OS << ""; |
| if (TrailingOmittedArgs < 1) |
| OS << ")"; |
| OS << ""; |
| break; |
| } |
| } |
| } |
| |
| const char *AlignedAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "aligned"; |
| case 1: |
| return "aligned"; |
| case 2: |
| return "align"; |
| case 3: |
| return "alignas"; |
| case 4: |
| return "_Alignas"; |
| } |
| } |
| |
| AllocAlignAttr *AllocAlignAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AllocAlignAttr(getLocation(), C, paramIndex, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AllocAlignAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((alloc_align(" << getParamIndex().getSourceIndex() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::alloc_align(" << getParamIndex().getSourceIndex() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AllocAlignAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "alloc_align"; |
| case 1: |
| return "alloc_align"; |
| } |
| } |
| |
| AllocSizeAttr *AllocSizeAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AllocSizeAttr(getLocation(), C, elemSizeParam, numElemsParam, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AllocSizeAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((alloc_size"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!getNumElemsParam().isValid()) |
| ++TrailingOmittedArgs; |
| OS << "(" << getElemSizeParam().getSourceIndex() << ""; |
| if (1 < 2 - TrailingOmittedArgs) |
| OS << ", "; |
| OS << ""; |
| if (!(!getNumElemsParam().isValid())) { |
| OS << "" << getNumElemsParam().getSourceIndex() << ""; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::alloc_size"; |
| unsigned TrailingOmittedArgs = 0; |
| if (!getNumElemsParam().isValid()) |
| ++TrailingOmittedArgs; |
| OS << "(" << getElemSizeParam().getSourceIndex() << ""; |
| if (1 < 2 - TrailingOmittedArgs) |
| OS << ", "; |
| OS << ""; |
| if (!(!getNumElemsParam().isValid())) { |
| OS << "" << getNumElemsParam().getSourceIndex() << ""; |
| } |
| OS << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AllocSizeAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "alloc_size"; |
| case 1: |
| return "alloc_size"; |
| } |
| } |
| |
| AlwaysDestroyAttr *AlwaysDestroyAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AlwaysDestroyAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AlwaysDestroyAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((always_destroy))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::always_destroy]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AlwaysDestroyAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "always_destroy"; |
| case 1: |
| return "always_destroy"; |
| } |
| } |
| |
| AlwaysInlineAttr *AlwaysInlineAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AlwaysInlineAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AlwaysInlineAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((always_inline))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::always_inline]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __forceinline"; |
| break; |
| } |
| } |
| } |
| |
| const char *AlwaysInlineAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "always_inline"; |
| case 1: |
| return "always_inline"; |
| case 2: |
| return "__forceinline"; |
| } |
| } |
| |
| AnalyzerNoReturnAttr *AnalyzerNoReturnAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AnalyzerNoReturnAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AnalyzerNoReturnAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((analyzer_noreturn))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AnalyzerNoReturnAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "analyzer_noreturn"; |
| } |
| } |
| |
| AnnotateAttr *AnnotateAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AnnotateAttr(getLocation(), C, getAnnotation(), getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AnnotateAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((annotate(\"" << getAnnotation() << "\")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::annotate(\"" << getAnnotation() << "\")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::annotate(\"" << getAnnotation() << "\")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AnnotateAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "annotate"; |
| case 1: |
| return "annotate"; |
| case 2: |
| return "annotate"; |
| } |
| } |
| |
| AnyX86InterruptAttr *AnyX86InterruptAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AnyX86InterruptAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AnyX86InterruptAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((interrupt))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::interrupt]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AnyX86InterruptAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "interrupt"; |
| case 1: |
| return "interrupt"; |
| } |
| } |
| |
| AnyX86NoCallerSavedRegistersAttr *AnyX86NoCallerSavedRegistersAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AnyX86NoCallerSavedRegistersAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AnyX86NoCallerSavedRegistersAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((no_caller_saved_registers))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::no_caller_saved_registers]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AnyX86NoCallerSavedRegistersAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "no_caller_saved_registers"; |
| case 1: |
| return "no_caller_saved_registers"; |
| } |
| } |
| |
| AnyX86NoCfCheckAttr *AnyX86NoCfCheckAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AnyX86NoCfCheckAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AnyX86NoCfCheckAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((nocf_check))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::nocf_check]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AnyX86NoCfCheckAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "nocf_check"; |
| case 1: |
| return "nocf_check"; |
| } |
| } |
| |
| ArcWeakrefUnavailableAttr *ArcWeakrefUnavailableAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ArcWeakrefUnavailableAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ArcWeakrefUnavailableAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((objc_arc_weak_reference_unavailable))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::objc_arc_weak_reference_unavailable]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::objc_arc_weak_reference_unavailable]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ArcWeakrefUnavailableAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "objc_arc_weak_reference_unavailable"; |
| case 1: |
| return "objc_arc_weak_reference_unavailable"; |
| case 2: |
| return "objc_arc_weak_reference_unavailable"; |
| } |
| } |
| |
| ArgumentWithTypeTagAttr *ArgumentWithTypeTagAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ArgumentWithTypeTagAttr(getLocation(), C, argumentKind, argumentIdx, typeTagIdx, isPointer, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ArgumentWithTypeTagAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((argument_with_type_tag(" << (getArgumentKind() ? getArgumentKind()->getName() : "") << ", " << getArgumentIdx().getSourceIndex() << ", " << getTypeTagIdx().getSourceIndex() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::argument_with_type_tag(" << (getArgumentKind() ? getArgumentKind()->getName() : "") << ", " << getArgumentIdx().getSourceIndex() << ", " << getTypeTagIdx().getSourceIndex() << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::argument_with_type_tag(" << (getArgumentKind() ? getArgumentKind()->getName() : "") << ", " << getArgumentIdx().getSourceIndex() << ", " << getTypeTagIdx().getSourceIndex() << ")]]"; |
| break; |
| } |
| case 3 : { |
| OS << " __attribute__((pointer_with_type_tag(" << (getArgumentKind() ? getArgumentKind()->getName() : "") << ", " << getArgumentIdx().getSourceIndex() << ", " << getTypeTagIdx().getSourceIndex() << ")))"; |
| break; |
| } |
| case 4 : { |
| OS << " [[clang::pointer_with_type_tag(" << (getArgumentKind() ? getArgumentKind()->getName() : "") << ", " << getArgumentIdx().getSourceIndex() << ", " << getTypeTagIdx().getSourceIndex() << ")]]"; |
| break; |
| } |
| case 5 : { |
| OS << " [[clang::pointer_with_type_tag(" << (getArgumentKind() ? getArgumentKind()->getName() : "") << ", " << getArgumentIdx().getSourceIndex() << ", " << getTypeTagIdx().getSourceIndex() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ArgumentWithTypeTagAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "argument_with_type_tag"; |
| case 1: |
| return "argument_with_type_tag"; |
| case 2: |
| return "argument_with_type_tag"; |
| case 3: |
| return "pointer_with_type_tag"; |
| case 4: |
| return "pointer_with_type_tag"; |
| case 5: |
| return "pointer_with_type_tag"; |
| } |
| } |
| |
| ArtificialAttr *ArtificialAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ArtificialAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ArtificialAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((artificial))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::artificial]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ArtificialAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "artificial"; |
| case 1: |
| return "artificial"; |
| } |
| } |
| |
| AsmLabelAttr *AsmLabelAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AsmLabelAttr(getLocation(), C, getLabel(), getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AsmLabelAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " asm(\"" << getLabel() << "\")"; |
| break; |
| } |
| case 1 : { |
| OS << " __asm__(\"" << getLabel() << "\")"; |
| break; |
| } |
| } |
| } |
| |
| const char *AsmLabelAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "asm"; |
| case 1: |
| return "__asm__"; |
| } |
| } |
| |
| AssertCapabilityAttr *AssertCapabilityAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AssertCapabilityAttr(getLocation(), C, args_, args_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AssertCapabilityAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((assert_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::assert_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __attribute__((assert_shared_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 3 : { |
| OS << " [[clang::assert_shared_capability("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AssertCapabilityAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "assert_capability"; |
| case 1: |
| return "assert_capability"; |
| case 2: |
| return "assert_shared_capability"; |
| case 3: |
| return "assert_shared_capability"; |
| } |
| } |
| |
| AssertExclusiveLockAttr *AssertExclusiveLockAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AssertExclusiveLockAttr(getLocation(), C, args_, args_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AssertExclusiveLockAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((assert_exclusive_lock("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AssertExclusiveLockAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "assert_exclusive_lock"; |
| } |
| } |
| |
| AssertSharedLockAttr *AssertSharedLockAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AssertSharedLockAttr(getLocation(), C, args_, args_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AssertSharedLockAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((assert_shared_lock("; |
| bool isFirst = true; |
| for (const auto &Val : args()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| } |
| } |
| |
| const char *AssertSharedLockAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "assert_shared_lock"; |
| } |
| } |
| |
| AssumeAlignedAttr *AssumeAlignedAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AssumeAlignedAttr(getLocation(), C, alignment, offset, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AssumeAlignedAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((assume_aligned(" << getAlignment() << ", " << getOffset() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::assume_aligned(" << getAlignment() << ", " << getOffset() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AssumeAlignedAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "assume_aligned"; |
| case 1: |
| return "assume_aligned"; |
| } |
| } |
| |
| AvailabilityAttr *AvailabilityAttr::clone(ASTContext &C) const { |
| auto *A = new (C) AvailabilityAttr(getLocation(), C, platform, getIntroduced(), getDeprecated(), getObsoleted(), unavailable, getMessage(), strict, getReplacement(), priority, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void AvailabilityAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((availability(" << getPlatform()->getName(); |
| if (getStrict()) OS << ", strict"; |
| if (!getIntroduced().empty()) OS << ", introduced=" << getIntroduced(); |
| if (!getDeprecated().empty()) OS << ", deprecated=" << getDeprecated(); |
| if (!getObsoleted().empty()) OS << ", obsoleted=" << getObsoleted(); |
| if (getUnavailable()) OS << ", unavailable"; |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::availability(" << (getPlatform() ? getPlatform()->getName() : "") << ", introduced=" << getIntroduced() << ", deprecated=" << getDeprecated() << ", obsoleted=" << getObsoleted() << ", " << getUnavailable() << ", \"" << getMessage() << "\", " << getStrict() << ", \"" << getReplacement() << "\", " << getPriority() << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::availability(" << (getPlatform() ? getPlatform()->getName() : "") << ", introduced=" << getIntroduced() << ", deprecated=" << getDeprecated() << ", obsoleted=" << getObsoleted() << ", " << getUnavailable() << ", \"" << getMessage() << "\", " << getStrict() << ", \"" << getReplacement() << "\", " << getPriority() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *AvailabilityAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "availability"; |
| case 1: |
| return "availability"; |
| case 2: |
| return "availability"; |
| } |
| } |
| |
| BlocksAttr *BlocksAttr::clone(ASTContext &C) const { |
| auto *A = new (C) BlocksAttr(getLocation(), C, type, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void BlocksAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((blocks(\"" << BlocksAttr::ConvertBlockTypeToStr(getType()) << "\")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::blocks(\"" << BlocksAttr::ConvertBlockTypeToStr(getType()) << "\")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::blocks(\"" << BlocksAttr::ConvertBlockTypeToStr(getType()) << "\")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *BlocksAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "blocks"; |
| case 1: |
| return "blocks"; |
| case 2: |
| return "blocks"; |
| } |
| } |
| |
| C11NoReturnAttr *C11NoReturnAttr::clone(ASTContext &C) const { |
| auto *A = new (C) C11NoReturnAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void C11NoReturnAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " _Noreturn"; |
| break; |
| } |
| } |
| } |
| |
| const char *C11NoReturnAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "_Noreturn"; |
| } |
| } |
| |
| CDeclAttr *CDeclAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CDeclAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CDeclAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cdecl))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::cdecl]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __cdecl"; |
| break; |
| } |
| case 3 : { |
| OS << " _cdecl"; |
| break; |
| } |
| } |
| } |
| |
| const char *CDeclAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cdecl"; |
| case 1: |
| return "cdecl"; |
| case 2: |
| return "__cdecl"; |
| case 3: |
| return "_cdecl"; |
| } |
| } |
| |
| CFAuditedTransferAttr *CFAuditedTransferAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CFAuditedTransferAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CFAuditedTransferAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cf_audited_transfer))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cf_audited_transfer]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cf_audited_transfer]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CFAuditedTransferAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cf_audited_transfer"; |
| case 1: |
| return "cf_audited_transfer"; |
| case 2: |
| return "cf_audited_transfer"; |
| } |
| } |
| |
| CFConsumedAttr *CFConsumedAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CFConsumedAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CFConsumedAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cf_consumed))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cf_consumed]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cf_consumed]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CFConsumedAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cf_consumed"; |
| case 1: |
| return "cf_consumed"; |
| case 2: |
| return "cf_consumed"; |
| } |
| } |
| |
| CFReturnsNotRetainedAttr *CFReturnsNotRetainedAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CFReturnsNotRetainedAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CFReturnsNotRetainedAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cf_returns_not_retained))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cf_returns_not_retained]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cf_returns_not_retained]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CFReturnsNotRetainedAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cf_returns_not_retained"; |
| case 1: |
| return "cf_returns_not_retained"; |
| case 2: |
| return "cf_returns_not_retained"; |
| } |
| } |
| |
| CFReturnsRetainedAttr *CFReturnsRetainedAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CFReturnsRetainedAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CFReturnsRetainedAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cf_returns_retained))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cf_returns_retained]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cf_returns_retained]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CFReturnsRetainedAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cf_returns_retained"; |
| case 1: |
| return "cf_returns_retained"; |
| case 2: |
| return "cf_returns_retained"; |
| } |
| } |
| |
| CFUnknownTransferAttr *CFUnknownTransferAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CFUnknownTransferAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CFUnknownTransferAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cf_unknown_transfer))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cf_unknown_transfer]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cf_unknown_transfer]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CFUnknownTransferAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cf_unknown_transfer"; |
| case 1: |
| return "cf_unknown_transfer"; |
| case 2: |
| return "cf_unknown_transfer"; |
| } |
| } |
| |
| CPUDispatchAttr *CPUDispatchAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CPUDispatchAttr(getLocation(), C, cpus_, cpus_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CPUDispatchAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cpu_dispatch("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cpu_dispatch("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cpu_dispatch("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 3 : { |
| OS << " __declspec(cpu_dispatch("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << "))"; |
| break; |
| } |
| } |
| } |
| |
| const char *CPUDispatchAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cpu_dispatch"; |
| case 1: |
| return "cpu_dispatch"; |
| case 2: |
| return "cpu_dispatch"; |
| case 3: |
| return "cpu_dispatch"; |
| } |
| } |
| |
| CPUSpecificAttr *CPUSpecificAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CPUSpecificAttr(getLocation(), C, cpus_, cpus_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CPUSpecificAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cpu_specific("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::cpu_specific("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::cpu_specific("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 3 : { |
| OS << " __declspec(cpu_specific("; |
| bool isFirst = true; |
| for (const auto &Val : cpus()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << "))"; |
| break; |
| } |
| } |
| } |
| |
| const char *CPUSpecificAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cpu_specific"; |
| case 1: |
| return "cpu_specific"; |
| case 2: |
| return "cpu_specific"; |
| case 3: |
| return "cpu_specific"; |
| } |
| } |
| |
| CUDAConstantAttr *CUDAConstantAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDAConstantAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDAConstantAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((constant))"; |
| break; |
| } |
| case 1 : { |
| OS << " __declspec(__constant__)"; |
| break; |
| } |
| } |
| } |
| |
| const char *CUDAConstantAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "constant"; |
| case 1: |
| return "__constant__"; |
| } |
| } |
| |
| CUDADeviceAttr *CUDADeviceAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDADeviceAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDADeviceAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((device))"; |
| break; |
| } |
| case 1 : { |
| OS << " __declspec(__device__)"; |
| break; |
| } |
| } |
| } |
| |
| const char *CUDADeviceAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "device"; |
| case 1: |
| return "__device__"; |
| } |
| } |
| |
| CUDAGlobalAttr *CUDAGlobalAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDAGlobalAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDAGlobalAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((global))"; |
| break; |
| } |
| case 1 : { |
| OS << " __declspec(__global__)"; |
| break; |
| } |
| } |
| } |
| |
| const char *CUDAGlobalAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "global"; |
| case 1: |
| return "__global__"; |
| } |
| } |
| |
| CUDAHostAttr *CUDAHostAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDAHostAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDAHostAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((host))"; |
| break; |
| } |
| case 1 : { |
| OS << " __declspec(__host__)"; |
| break; |
| } |
| } |
| } |
| |
| const char *CUDAHostAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "host"; |
| case 1: |
| return "__host__"; |
| } |
| } |
| |
| CUDAInvalidTargetAttr *CUDAInvalidTargetAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDAInvalidTargetAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDAInvalidTargetAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| } |
| |
| const char *CUDAInvalidTargetAttr::getSpelling() const { |
| return "(No spelling)"; |
| } |
| |
| CUDALaunchBoundsAttr *CUDALaunchBoundsAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDALaunchBoundsAttr(getLocation(), C, maxThreads, minBlocks, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDALaunchBoundsAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((launch_bounds(" << getMaxThreads() << ", " << getMinBlocks() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " __declspec(__launch_bounds__(" << getMaxThreads() << ", " << getMinBlocks() << "))"; |
| break; |
| } |
| } |
| } |
| |
| const char *CUDALaunchBoundsAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "launch_bounds"; |
| case 1: |
| return "__launch_bounds__"; |
| } |
| } |
| |
| CUDASharedAttr *CUDASharedAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CUDASharedAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CUDASharedAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((shared))"; |
| break; |
| } |
| case 1 : { |
| OS << " __declspec(__shared__)"; |
| break; |
| } |
| } |
| } |
| |
| const char *CUDASharedAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "shared"; |
| case 1: |
| return "__shared__"; |
| } |
| } |
| |
| CXX11NoReturnAttr *CXX11NoReturnAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CXX11NoReturnAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CXX11NoReturnAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " [[noreturn]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CXX11NoReturnAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "noreturn"; |
| } |
| } |
| |
| CallableWhenAttr *CallableWhenAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CallableWhenAttr(getLocation(), C, callableStates_, callableStates_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CallableWhenAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((callable_when("; |
| bool isFirst = true; |
| for (const auto &Val : callableStates()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << "\"" << CallableWhenAttr::ConvertConsumedStateToStr(Val)<< "\""; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::callable_when("; |
| bool isFirst = true; |
| for (const auto &Val : callableStates()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << "\"" << CallableWhenAttr::ConvertConsumedStateToStr(Val)<< "\""; |
| } |
| OS << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CallableWhenAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "callable_when"; |
| case 1: |
| return "callable_when"; |
| } |
| } |
| |
| CallbackAttr *CallbackAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CallbackAttr(getLocation(), C, encoding_, encoding_Size, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CallbackAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((callback("; |
| bool isFirst = true; |
| for (const auto &Val : encoding()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::callback("; |
| bool isFirst = true; |
| for (const auto &Val : encoding()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " [[clang::callback("; |
| bool isFirst = true; |
| for (const auto &Val : encoding()) { |
| if (isFirst) isFirst = false; |
| else OS << ", "; |
| OS << Val; |
| } |
| OS << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CallbackAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "callback"; |
| case 1: |
| return "callback"; |
| case 2: |
| return "callback"; |
| } |
| } |
| |
| CapabilityAttr *CapabilityAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CapabilityAttr(getLocation(), C, getName(), getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CapabilityAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((capability(\"" << getName() << "\")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::capability(\"" << getName() << "\")]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __attribute__((shared_capability(\"" << getName() << "\")))"; |
| break; |
| } |
| case 3 : { |
| OS << " [[clang::shared_capability(\"" << getName() << "\")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CapabilityAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "capability"; |
| case 1: |
| return "capability"; |
| case 2: |
| return "shared_capability"; |
| case 3: |
| return "shared_capability"; |
| } |
| } |
| |
| CapturedRecordAttr *CapturedRecordAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CapturedRecordAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CapturedRecordAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| } |
| |
| const char *CapturedRecordAttr::getSpelling() const { |
| return "(No spelling)"; |
| } |
| |
| CarriesDependencyAttr *CarriesDependencyAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CarriesDependencyAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CarriesDependencyAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((carries_dependency))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[carries_dependency]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CarriesDependencyAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "carries_dependency"; |
| case 1: |
| return "carries_dependency"; |
| } |
| } |
| |
| CleanupAttr *CleanupAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CleanupAttr(getLocation(), C, functionDecl, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CleanupAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cleanup(" << getFunctionDecl()->getNameInfo().getAsString() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::cleanup(" << getFunctionDecl()->getNameInfo().getAsString() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CleanupAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cleanup"; |
| case 1: |
| return "cleanup"; |
| } |
| } |
| |
| CodeSegAttr *CodeSegAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CodeSegAttr(getLocation(), C, getName(), getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CodeSegAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __declspec(code_seg(\"" << getName() << "\"))"; |
| break; |
| } |
| } |
| } |
| |
| const char *CodeSegAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "code_seg"; |
| } |
| } |
| |
| ColdAttr *ColdAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ColdAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ColdAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((cold))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::cold]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ColdAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "cold"; |
| case 1: |
| return "cold"; |
| } |
| } |
| |
| CommonAttr *CommonAttr::clone(ASTContext &C) const { |
| auto *A = new (C) CommonAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void CommonAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((common))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::common]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *CommonAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "common"; |
| case 1: |
| return "common"; |
| } |
| } |
| |
| ConstAttr *ConstAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ConstAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ConstAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((const))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::const]]"; |
| break; |
| } |
| case 2 : { |
| OS << " __attribute__((__const))"; |
| break; |
| } |
| case 3 : { |
| OS << " [[gnu::__const]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ConstAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "const"; |
| case 1: |
| return "const"; |
| case 2: |
| return "__const"; |
| case 3: |
| return "__const"; |
| } |
| } |
| |
| ConstructorAttr *ConstructorAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ConstructorAttr(getLocation(), C, priority, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ConstructorAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((constructor(" << getPriority() << ")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[gnu::constructor(" << getPriority() << ")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ConstructorAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "constructor"; |
| case 1: |
| return "constructor"; |
| } |
| } |
| |
| ConsumableAttr *ConsumableAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ConsumableAttr(getLocation(), C, defaultState, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ConsumableAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((consumable(\"" << ConsumableAttr::ConvertConsumedStateToStr(getDefaultState()) << "\")))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::consumable(\"" << ConsumableAttr::ConvertConsumedStateToStr(getDefaultState()) << "\")]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ConsumableAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "consumable"; |
| case 1: |
| return "consumable"; |
| } |
| } |
| |
| ConsumableAutoCastAttr *ConsumableAutoCastAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ConsumableAutoCastAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ConsumableAutoCastAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((consumable_auto_cast_state))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::consumable_auto_cast_state]]"; |
| break; |
| } |
| } |
| } |
| |
| const char *ConsumableAutoCastAttr::getSpelling() const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| return "(No spelling)"; |
| case 0: |
| return "consumable_auto_cast_state"; |
| case 1: |
| return "consumable_auto_cast_state"; |
| } |
| } |
| |
| ConsumableSetOnReadAttr *ConsumableSetOnReadAttr::clone(ASTContext &C) const { |
| auto *A = new (C) ConsumableSetOnReadAttr(getLocation(), C, getSpellingListIndex()); |
| A->Inherited = Inherited; |
| A->IsPackExpansion = IsPackExpansion; |
| A->Implicit = Implicit; |
| return A; |
| } |
| |
| void ConsumableSetOnReadAttr::printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const { |
| switch (SpellingListIndex) { |
| default: |
| llvm_unreachable("Unknown attribute spelling!"); |
| break; |
| case 0 : { |
| OS << " __attribute__((consumable_set_state_on_read))"; |
| break; |
| } |
| case 1 : { |
| OS << " [[clang::consumable_set_state_on_read]]"; |
| break; |
| } |
| } |
| } |
| |