[clang] [clang] Fix pretty-printing assume_aligned attributes (PR #67331)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 26 00:08:02 PDT 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 9f276d4ddd0efa2e323d674a35317c253ab66d58 67e19382fb45fe5e06a5c8de2e7b1434c8b1c68f -- clang/test/AST/attr-print-emit.cpp clang/utils/TableGen/ClangAttrEmitter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index effeba51e99e..a572810c3cf4 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -3176,26 +3176,26 @@ namespace clang {
// Emits the enumeration list for attributes.
void EmitClangAttrList(RecordKeeper &Records, raw_ostream &OS) {
- emitSourceFileHeader("List of all attributes that Clang recognizes", OS);
+ emitSourceFileHeader("List of all attributes that Clang recognizes", OS);
- AttrClassHierarchy Hierarchy(Records);
+ AttrClassHierarchy Hierarchy(Records);
- // Add defaulting macro definitions.
- Hierarchy.emitDefaultDefines(OS);
- emitDefaultDefine(OS, "PRAGMA_SPELLING_ATTR", nullptr);
+ // Add defaulting macro definitions.
+ Hierarchy.emitDefaultDefines(OS);
+ emitDefaultDefine(OS, "PRAGMA_SPELLING_ATTR", nullptr);
- std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr");
- std::vector<Record *> PragmaAttrs;
- for (auto *Attr : Attrs) {
- if (!Attr->getValueAsBit("ASTNode"))
- continue;
+ std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr");
+ std::vector<Record *> PragmaAttrs;
+ for (auto *Attr : Attrs) {
+ if (!Attr->getValueAsBit("ASTNode"))
+ continue;
- // Add the attribute to the ad-hoc groups.
- if (AttrHasPragmaSpelling(Attr))
- PragmaAttrs.push_back(Attr);
+ // Add the attribute to the ad-hoc groups.
+ if (AttrHasPragmaSpelling(Attr))
+ PragmaAttrs.push_back(Attr);
- // Place it in the hierarchy.
- Hierarchy.classifyAttr(Attr);
+ // Place it in the hierarchy.
+ Hierarchy.classifyAttr(Attr);
}
// Emit the main attribute list.
@@ -3594,7 +3594,8 @@ void EmitClangAttrHasAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
void EmitClangAttrSpellingListIndex(RecordKeeper &Records, raw_ostream &OS) {
emitSourceFileHeader("Code to translate different attribute spellings "
- "into internal identifiers", OS);
+ "into internal identifiers",
+ OS);
OS << " switch (getParsedKind()) {\n";
OS << " case IgnoredAttribute:\n";
@@ -4687,8 +4688,7 @@ void EmitClangAttrNodeTraverse(RecordKeeper &Records, raw_ostream &OS) {
}
}
-void EmitClangAttrParserStringSwitches(RecordKeeper &Records,
- raw_ostream &OS) {
+void EmitClangAttrParserStringSwitches(RecordKeeper &Records, raw_ostream &OS) {
emitSourceFileHeader("Parser-related llvm::StringSwitch cases", OS);
emitClangAttrArgContextList(Records, OS);
emitClangAttrIdentifierArgList(Records, OS);
``````````
</details>
https://github.com/llvm/llvm-project/pull/67331
More information about the cfe-commits
mailing list