================ @@ -148,13 +150,151 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer { OS << "\t.seh_save_any_reg_px\tq" << Reg << ", " << Offset << "\n"; } + void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value, + std::string String, bool Override) override { + + // AArch64 build attributes for assembly attribute form: + // .aeabi_attribute tag, value + if (unsigned(-1) == Value && "" == String) { + assert(0 && "Arguments error"); + return; + } + + unsigned VendorID = AArch64BuildAttributes::getVendorID(VendorName); + + switch (VendorID) { + default: + assert(0 && "Subsection name error"); + break; + case AArch64BuildAttributes::VENDOR_UNKNOWN: + if (unsigned(-1) != Value) { + OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value; + AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "", + Override); + } + if ("" != String) { + OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << String; + AArch64TargetStreamer::emitAttribute(VendorName, Tag, unsigned(-1), + String, Override); + } + break; + // Note: AEABI_FEATURE_AND_BITS takes only unsigned values + case AArch64BuildAttributes::AEABI_FEATURE_AND_BITS: + switch (Tag) { + default: // allow emitting any attribute by number + OS << "\t.aeabi_attribute" << "\t" << Tag << ", " << Value; + // Keep the data structure consistent with the case of ELF emission + // (important for llvm-mc asm parsing) + AArch64TargetStreamer::emitAttribute(VendorName, Tag, Value, "", + Override); + break; + case AArch64BuildAttributes::TAG_FEATURE_BTI: + LLVM_FALLTHROUGH; ---------------- ostannard wrote:
You don't need to use `LLVM_FALLTHROUGH` if there is no code between two `case` statements. https://github.com/llvm/llvm-project/pull/118771 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits