================ @@ -625,6 +625,41 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &AL, + SourceRange Range) { + if (!AL.checkAtLeastNumArgs(S, 1)) + return nullptr; + + if (!isa<CompoundStmt>(St)) { + S.Diag(St->getBeginLoc(), diag::err_attribute_wrong_decl_type) + << AL << "compound statement"; + return nullptr; + } + + SmallVector<AtomicAttr::ConsumedOption, 6> Options; + for (unsigned ArgIndex = 0; ArgIndex < AL.getNumArgs(); ++ArgIndex) { + AtomicAttr::ConsumedOption Option; + StringRef OptionString; + SourceLocation Loc; + if (AL.isArgIdent(ArgIndex)) { + IdentifierLoc *Ident = AL.getArgAsIdent(ArgIndex); + OptionString = Ident->Ident->getName(); + Loc = Ident->Loc; + } else { + if (!S.checkStringLiteralArgumentAttr(AL, ArgIndex, OptionString, &Loc)) ---------------- erichkeane wrote:
Do we allow string arguments anymore? I THINK the point of this else-branch is we would permit: ` [[clang::atomic("no_remote_memory")]]` Which we aren't documenting anywhere. https://github.com/llvm/llvm-project/pull/114841 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits