From 85acf61368c6d8c4c17ae7d8707d79f0348ec239 Mon Sep 17 00:00:00 2001 From: urandon Date: Wed, 10 May 2023 23:52:47 +0300 Subject: [PATCH] [OHOS][test] fix master CI regressions - fix test pramga-attribute-supported-attributes=list by adding new attrs appeared in https://gitee.com/open_harmony/dashboard?issue_id=I6I9SX - follow conventions: OHOS_LOCAL start -> OHOS_LOCAL begin Relates: https://gitee.com/open_harmony/dashboard?issue_id=I6ZYPC Tests: CI Signed-off-by: urandon --- clang/include/clang/Basic/Attr.td | 2 +- clang/include/clang/Basic/AttrDocs.td | 2 +- clang/include/clang/Basic/DiagnosticParseKinds.td | 2 +- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- clang/lib/CodeGen/CodeGenTypes.cpp | 2 +- clang/lib/Parse/ParseDecl.cpp | 2 +- clang/lib/Sema/SemaDeclAttr.cpp | 2 +- .../Misc/pragma-attribute-supported-attributes-list.test | 4 ++++ llvm/lib/Target/AArch64/AArch64.h | 2 +- llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 2 +- llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h | 2 +- llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | 6 +++--- llvm/lib/Target/AArch64/CMakeLists.txt | 4 ++-- 13 files changed, 19 insertions(+), 15 deletions(-) diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 3c11f7ba85ae..7416f4757f8c 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -1742,7 +1742,7 @@ def NoUniqueAddress : InheritableAttr, TargetSpecificAttr { let SimpleHandler = 1; } -// OHOS_LOCAL start +// OHOS_LOCAL begin def PacDataTag : InheritableAttr { let Spellings = [GCC<"pac_protected_data">]; let Subjects = SubjectList<[Field], ErrorDiag>; diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index ff9a7c5bc84a..4604c6a0161b 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -1355,7 +1355,7 @@ in C++11 onwards. }]; } -// OHOS_LOCAL start +// OHOS_LOCAL begin def PacDataTagDocs : Documentation { let Category = DocCatField; let Content = [{ diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index 037e29a5155f..17b040d33dc2 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -1610,7 +1610,7 @@ def ext_hlsl_access_specifiers : ExtWarn< "access specifiers are a clang HLSL extension">, InGroup; -// OHOS_LOCAL start +// OHOS_LOCAL begin def warn_unsupported_pac_dfi_type : Warning< "unsupported type %0 for attribute '%1'">; // OHOS_LOCAL end diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index aa52d65dafe8..511e390e8aaf 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -47,7 +47,7 @@ #include "clang/CodeGen/BackendUtil.h" #include "clang/CodeGen/ConstantInitBuilder.h" #include "clang/Frontend/FrontendDiagnostic.h" -// OHOS_LOCAL start +// OHOS_LOCAL begin #include "clang/Pac/PacDfi.h" // OHOS_LOCAL end #include "llvm/ADT/StringSwitch.h" diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index 97725ccbae8c..59658dfb793f 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -22,7 +22,7 @@ #include "clang/AST/Expr.h" #include "clang/AST/RecordLayout.h" #include "clang/CodeGen/CGFunctionInfo.h" -// OHOS_LOCAL start +// OHOS_LOCAL begin #include "clang/Pac/PacDfi.h" // OHOS_LOCAL end #include "llvm/IR/DataLayout.h" diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 92944a127fcb..bd8295d9cef6 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -25,7 +25,7 @@ #include "clang/Sema/ParsedTemplate.h" #include "clang/Sema/Scope.h" #include "clang/Sema/SemaDiagnostic.h" -// OHOS_LOCAL start +// OHOS_LOCAL begin #include "clang/Pac/PacDfi.h" // OHOS_LOCAL end #include "llvm/ADT/Optional.h" diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index bac86bb767a1..ed6d1cc923cc 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -9093,7 +9093,7 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL, case ParsedAttr::AT_UsingIfExists: handleSimpleAttribute(S, D, AL); break; - // OHOS_LOCAL start + // OHOS_LOCAL begin case ParsedAttr::AT_PacDataTag: handleSimpleAttribute(S, D, AL); break; diff --git a/clang/test/Misc/pragma-attribute-supported-attributes-list.test b/clang/test/Misc/pragma-attribute-supported-attributes-list.test index 64e2bf619004..6192296477c5 100644 --- a/clang/test/Misc/pragma-attribute-supported-attributes-list.test +++ b/clang/test/Misc/pragma-attribute-supported-attributes-list.test @@ -146,6 +146,10 @@ // CHECK-NEXT: OptimizeNone (SubjectMatchRule_function, SubjectMatchRule_objc_method) // CHECK-NEXT: Overloadable (SubjectMatchRule_function) // CHECK-NEXT: Owner (SubjectMatchRule_record_not_is_union) +// OHOS_LOCAL begin +// CHECK-NEXT: PacDataTag (SubjectMatchRule_field) +// CHECK-NEXT: PacPtrTag (SubjectMatchRule_field) +// OHOS_LOCAL end // CHECK-NEXT: ParamTypestate (SubjectMatchRule_variable_is_parameter) // CHECK-NEXT: PassObjectSize (SubjectMatchRule_variable_is_parameter) // CHECK-NEXT: PatchableFunctionEntry (SubjectMatchRule_function, SubjectMatchRule_objc_method) diff --git a/llvm/lib/Target/AArch64/AArch64.h b/llvm/lib/Target/AArch64/AArch64.h index 0fbd926dadf2..79e2dc2a2db5 100644 --- a/llvm/lib/Target/AArch64/AArch64.h +++ b/llvm/lib/Target/AArch64/AArch64.h @@ -68,7 +68,7 @@ FunctionPass *createAArch64PostLegalizerLowering(); FunctionPass *createAArch64PostSelectOptimize(); FunctionPass *createAArch64StackTaggingPass(bool IsOptNone); FunctionPass *createAArch64StackTaggingPreRAPass(); -// OHOS_LOCAL start +// OHOS_LOCAL begin FunctionPass *createAArch64EarlyPartsCpiPass(); FunctionPass *createAArch64PartsCpiPass(); FunctionPass *createPartsPassDpi(); diff --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp index 919006ce12bc..87f3982208fb 100644 --- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp +++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp @@ -1310,7 +1310,7 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) { EmitToStreamer(*OutStreamer, TmpInst); return; } - // OHOS_LOCAL start + // OHOS_LOCAL begin case AArch64::TCRETURNriAA: { MCInst TmpInst; TmpInst.setOpcode(AArch64::BRAA); diff --git a/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h b/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h index 5fbf1e7e195b..c658f821464e 100644 --- a/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h +++ b/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h @@ -435,7 +435,7 @@ public: bool needsDwarfUnwindInfo() const; bool needsAsyncDwarfUnwindInfo() const; - // OHOS_LOCAL start + // OHOS_LOCAL begin void setPartsSym(MCSymbol *Sym) { PartsSym = Sym; } MCSymbol *getPartsSym() const { return PartsSym; } // OHOS_LOCAL end diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp index 45628ae66e64..1c3a7576a08f 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp @@ -592,7 +592,7 @@ void AArch64PassConfig::addIRPasses() { if (TM->getTargetTriple().isOSWindows()) addPass(createCFGuardCheckPass()); - // OHOS_LOCAL start + // OHOS_LOCAL begin if (PARTS::useFeCfi()) addPass(PARTS::createPartsPluginPass()); // OHOS_LOCAL end @@ -649,7 +649,7 @@ bool AArch64PassConfig::addInstSelector() { getOptLevel() != CodeGenOpt::None) addPass(createAArch64CleanupLocalDynamicTLSPass()); - // OHOS_LOCAL start + // OHOS_LOCAL begin if (PARTS::useFeCfi()) // Replace indirect jump instruction such as : BR BLR --> BRAA BLRAA addPass(createAArch64EarlyPartsCpiPass()); @@ -817,7 +817,7 @@ void AArch64PassConfig::addPreEmitPass() { TM->getTargetTriple().isOSBinFormatMachO()) addPass(createAArch64CollectLOHPass()); - // OHOS_LOCAL start + // OHOS_LOCAL begin if (PARTS::useFeCfi()) addPass(createAArch64PartsCpiPass()); if ((PARTS::useDataPointerProtection())) diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt index 178b9eb34643..3aaad9a927a5 100644 --- a/llvm/lib/Target/AArch64/CMakeLists.txt +++ b/llvm/lib/Target/AArch64/CMakeLists.txt @@ -86,7 +86,7 @@ add_llvm_target(AArch64CodeGen AArch64TargetTransformInfo.cpp SVEIntrinsicOpts.cpp AArch64SIMDInstrOpt.cpp - # OHOS_LOCAL start + # OHOS_LOCAL begin AArch64PARTS/AArch64EarlyPartsCpiPass.cpp AArch64PARTS/AArch64PartsCpiPass.cpp AArch64PARTS/AArch64PartsDpiPass.cpp @@ -94,7 +94,7 @@ add_llvm_target(AArch64CodeGen DEPENDS intrinsics_gen - # OHOS_LOCAL start + # OHOS_LOCAL begin Parts LINK_LIBS -- Gitee